MCP Deep Dive, Part 5: Designing Custom MCP Tools Your Agents Actually Use Right
Most MCP tools mirror your REST API and confuse the model. Here's how to design task-shaped tools an agent picks right, calls cleanly, and trusts.
Posts and interview questions tagged CQRS.
Most MCP tools mirror your REST API and confuse the model. Here's how to design task-shaped tools an agent picks right, calls cleanly, and trusts.
The server exposes tools; the client drives them. Here's a production MCP client — discovery, the agent loop, multi-server routing, and reconnects.
A demo MCP server is a weekend; a production one needs typed tools, real error handling, pagination, and health checks. The Mattrx build, end to end.
MCP has a host, clients, servers, three primitives, and a capability handshake. Here is the full architecture, mapped onto Mattrx's real Azure setup.
Every AI agent you build needs every backend you own — that is N×M glue code. MCP turns it into N+M. Here is why, with real Mattrx production numbers.
Naive AI review drowns devs in false positives until they ignore it. Here's the context-aware, adversarially-verified pipeline we run on every Mattrx PR.
Delivering 15M webhooks a day to endpoints you don't control is deceptively hard. Here's the outbox + queue + retry design that never drops an event.
Chunk-and-embed RAG hits a wall at scale. Open Knowledge Format (OKF) feeds a context engine structured, governed knowledge — the Mattrx rebuild with code.
Most enterprises bolt AI onto a backend built for CRUD. We rebuilt Mattrx around nine AI-native layers in production. Here is the blueprint, with code.
Part 6: AI & data governance as a control plane — classification at ingestion, entitlement-aware retrieval, consent & purpose limits, data lineage, and policy-as-code in C# + Python.
Part 5: multi-tenant context engineering — tenant-scoped retrieval, per-tenant prompts and caches, noisy-neighbor fairness, model routing, and per-tenant cost attribution in C# + Python.
Part 4 : the enterprise design that makes GenAI production-grade — eval gates, injection + PII defense, cost control, and tracing.