Opening configurable systems to AI agents: getting MCP and agent tools right
MCP lets AI agents work with real systems, and configurable systems suit them well. How to design tools agents use well, keep agents within a person's permissions, and make their mistakes easy to undo.
Key takeaways
- Offer a few task-shaped tools with clear descriptions, not a mirror of every REST endpoint.
- Give agents tools that explain the system, validate input and plan changes before anything is written.
- Every tool call runs with the identity and permissions of the person behind the agent, through MCP’s OAuth flow.
- Version every change, keep activation separate, and treat everything an agent reads as untrusted data.
The Model Context Protocol (MCP) has quickly become the standard way for AI agents to use real systems: an MCP server publishes a set of tools, and any compatible agent or assistant can find and call them. For a flexible, configurable system that is a big opportunity. When business rules, processes and data definitions are configuration, an agent can read and change them just as a specialist would, and people can say what they want in plain language instead of clicking through ten screens.
It is also easy to get wrong. An MCP server is an API driven by a language model, and language models are confident, fast and now and then mistaken. Here is what we have learned matters when opening a configurable system to agents.
1. Design tools for the agent, not as a mirror of your REST API
Wrapping every existing endpoint as a tool is the obvious first move, and usually the wrong one. Agents do best with a small number of well-named tools that follow tasks, not tables:
- List and get tools that return compact summaries first, with identifiers the agent can use to ask for detail.
- Create and update tools per kind of configuration item that take the whole item, so the agent cannot leave it half-changed.
- Higher-level tools for common jobs that would otherwise need several calls, so the agent gets them right in one go.
Write tool descriptions the way you would brief a new colleague: what it does, when to use it, what to do first. The description is the only manual the agent has.
2. Let the agent learn the system through tools
Every flexible system has its own vocabulary and building blocks. Do not count on the model guessing them. Give it tools that explain the building blocks: which kinds of items exist, which fields each takes, which values are allowed, and short guides for common tasks. An agent that can ask “what does this item need?” makes far fewer mistakes than one working from a long system prompt.
3. Validate before writing, plan before applying
The most valuable tools are the ones that change nothing:
- Validate tools check a configuration item or a piece of logic and return precise, actionable errors. The agent fixes its own mistakes before anything is saved.
- Plan, then apply. For larger changes, one tool shows what would change and a second applies exactly that plan. A person, or a stricter policy, can approve in between.
- Server-side checks on every write regardless. Validation tools help the agent; they never replace the checks on save.
Error messages are part of the interface. “Invalid input” sends an agent round in circles. “Field ‘timeout’ must be a number of seconds between 1 and 300” solves the problem on the next call.
4. The agent acts as a person, with that person’s rights
Every tool call should run with the identity and permissions of the user behind the agent, checked by the same code that guards the user interface. Use the authorization flow MCP defines (OAuth) so each user signs in personally, rather than one shared key with broad rights. If a shared technical account cannot be avoided, scope it to the minimum and keep it away from anything an end user can reach. The wider principles are in keeping AI agents in bounds.
5. Make mistakes cheap to undo
- Version every change, so anything an agent did can be compared and rolled back.
- Keep activation separate. An agent may draft and save a change, but making it live in production can require a different permission, or a human.
- Make writes idempotent where possible, so a retried call does not create duplicates.
- Limit the blast radius: rate limits per user, size limits per call, and no bulk delete tools unless you truly need them.
6. Treat everything the agent reads as untrusted
Data in your system was written by many people, and some of it may contain text aimed at the model: “ignore previous instructions and…”. Tool results are data, not commands. Keep the agent’s permissions narrow enough that a successful prompt injection achieves little, and take extra care when one agent can use tools from several MCP servers at once: allow-list which servers it may use, and never let output from one quietly drive writes in another.
7. Publish your processes as tools too
MCP works in both directions. Besides letting agents configure the system, a flexible platform can publish its own processes as tools: “check availability”, “validate an address”, “look up an order’s status”. An assistant in a chat, or another team’s agent, then uses the business logic you already have, with the same rules, permissions and audit trail, instead of rebuilding it in a prompt. Give each published tool a clear input schema, a stable name and a version, as you would any public API.
8. Observe, measure and test
- Log every tool call with user, inputs, result and duration. When an agent does something surprising, you need to see exactly what it asked for.
- Keep results small. Paginate lists, summarise large objects, and return identifiers rather than full payloads. Huge responses cost money and confuse models (see cutting tokens without cutting quality).
- Evaluate with real tasks. Keep a set of typical requests and check regularly that agents still complete them correctly as tools or models change.
- Version your tools. Renaming a field in a tool schema is a breaking change for every agent that relies on it.
Checklist for an agent-ready system
- Task-shaped tools with clear descriptions, not a dump of every endpoint.
- Describe and guide tools so agents can learn the building blocks.
- Validate and plan tools that change nothing, plus precise error messages.
- Per-user identity and permissions on every call.
- Versioned changes, separate activation, rate and size limits.
- Tool output treated as untrusted data.
- Full logging, compact results, regular evaluation.
FAQ
What is the Model Context Protocol (MCP)?
MCP is an open protocol that lets AI agents and assistants discover and call tools published by a server. A system with an MCP server can be used by any compatible agent, with no custom integration for each one.
Should I expose my existing REST API as MCP tools one to one?
Usually not. Agents do better with a smaller set of tools that match tasks, return compact results and give precise error messages. Wrap the API in tools designed around how an agent works.
How should an MCP server handle authentication?
Use the OAuth-based authorization MCP defines, so each user signs in and the agent acts with that user’s permissions. Avoid one shared key with broad rights; if a technical account cannot be avoided, scope it to the minimum.
How do I protect an MCP server against prompt injection?
Treat tool results as data, not instructions, keep each agent’s permissions narrow, allow-list which MCP servers an agent may combine, and require a separate permission or a human to make changes live.
Done well, an MCP interface turns a configurable system into something people can simply talk to, without giving up control. Are you opening your own systems to agents? We would like to hear what worked and what surprised you.
