The easiest way to connect an API to an AI agent is to turn every endpoint into one MCP tool.
It is also one of the fastest ways to make the agent worse.
A large tool list creates a different kind of API design problem. The model has to choose from many similar operations, fit their descriptions and schemas into context, and understand which actions are safe. A tool that looks convenient in a demo can become ambiguous, expensive, or dangerous in production.
The better question is not, “How many endpoints can we expose?” It is:
What are the smallest, clearest actions an agent needs to complete a real task?
This article walks through a practical design process for infrastructure APIs, with examples that apply to VPS, cloud, monitoring, and deployment services.
Start with tasks, not endpoints
A REST API often has endpoints like:
GET /serversGET /servers/:idGET /servers/:id/metricsGET /servers/:id/eventsPOST /servers/:id/actionsPOST /servers/:id/snapshotsDELETE /servers/:id/snapshots/:snapshotId
Exposing all seven as separate MCP tools is technically possible. It is not automatically useful.
The agent usually needs to answer questions such as:
- Which server is unhealthy?
- What changed on that server recently?
- Is there enough disk space for a snapshot?
- Can I safely restart this server?
Group tools around those tasks. For example:
-
list_serversreturns a compact fleet summary. -
get_server_healthreturns status, recent metrics, and the latest events. -
list_snapshotsreturns snapshot summaries. -
create_snapshotstarts a cost- or storage-affecting action. -
server_action_challengeandserver_actionseparate a risky request from confirmation.
The exact names are less important than the shape. Each tool should have one clear job and a result that is easy for an agent to reason about.
Keep the list small enough to reason about
A recent analysis of eight public APIs exposed as MCP tools found that many conversions produce too many operations for an agent to choose reliably. The problem is not only token count. Similar names, near-duplicate actions, and huge optional schemas increase selection ambiguity.
A practical starting point:
- Prefer 5-15 high-level tools for a product area.
- Merge read operations that support the same question.
- Keep destructive operations separate.
- Avoid exposing internal or rarely used endpoints unless a real task needs them.
- Return summaries by default and expose detail only when requested.
This is an interface design decision, not a model limitation. A human would also struggle with twenty tools named get_server, get_server_details, get_server_info, and get_server_status.
Separate read, cost, and destructive actions
Every MCP tool should state its risk level in the name or description.
| Risk | Examples | Default behavior |
|---|---|---|
| Read-only | List servers, read metrics, list snapshots | Safe to call automatically |
| Cost-incurring | Buy a plan, resize, create a paid resource | Require an explicit quote and confirmation |
| Destructive | Reboot, reinstall, terminate, delete snapshot | Require a challenge or confirmation flow |
| Credential access | Read SSH connection details | Audit access and avoid placing secrets in model context |
Do not hide a destructive action inside a generic manage_server tool with an action enum. A narrow, explicit tool is easier to review and easier to audit.
For high-impact operations, use a two-step flow:
- A read-only tool returns the current state, expected effect, and a short-lived challenge or quote.
- A confirmation tool accepts the exact quote or challenge and performs the action once.
This lets the agent explain the consequence before the user authorizes it.
Return small, predictable results
Large API responses are a common source of agent failure. Returning every database field, nested object, and historical record makes the context noisy and increases the chance that the model misses the important value.
Prefer:
{ "serverId": "srv_123", "name": "api-1", "status": "running", "region": "eu", "cpuPercent": 72.4, "memoryPercent": 68.1, "diskPercent": 81.9, "lastSeenAt": "2026-12-01T09:40:00Z" } Instead of:
{ "server": { "raw": { "...": "large provider payload" }, "billing": { "...": "many unrelated fields" }, "history": ["... hundreds of records ..."] } } The tool description should tell the agent what the result means and when to request more detail. A separate get_server_events tool can handle pagination and a bounded time window.
Make permissions and audit trails visible
MCP makes it easy to give an agent a capability. It should also make the capability reviewable.
At minimum, record:
- Which tool ran
- Which account and workspace it ran for
- What arguments were supplied
- Whether it was read-only, cost-incurring, or destructive
- Which confirmation or quote authorized it
- Whether the action succeeded, failed, or returned an unknown result
- The resulting resource or task ID
This is especially important for agents that can spend money or change production infrastructure. A successful payment response is not enough if the process crashes before the result is recorded. The agent needs a durable record that can be queried later.
Caplock’s permission-layer model is useful here: make the exposed tool surface visible, compile policy into something enforceable, test what is allowed, and enforce the same decision at execution time. The exact implementation can vary, but the principle is sound: permission should not live only in a prompt.
Use a compact tool contract
A minimal tool definition should answer four questions:
- What does this tool do?
- What does it need?
- What does it return?
- What can go wrong?
Example:
{ name: "list_server_health", description: "List a compact health summary for servers in the current workspace. Use get_server_events for recent changes or get_server_metrics for a time series.", inputSchema: { type: "object", properties: { status: { type: "string", enum: ["running", "stopped", "error"] }, region: { type: "string" }, limit: { type: "integer", minimum: 1, maximum: 50 } }, additionalProperties: false } } The description points the model to the next useful tool. The schema is narrow. The result can be small. The action is read-only.
A review checklist
Before publishing an MCP server, review it as a product surface:
- Can each tool be explained in one sentence?
- Are there near-duplicate tools?
- Are destructive actions explicit and confirmed?
- Are cost-incurring actions separated from reads?
- Are credentials kept out of normal results?
- Are result sizes bounded?
- Does every write action have an audit record?
- Can an unknown result be queried without repeating the action?
- Do descriptions explain when to use a neighboring tool?
- Can the whole surface be understood from a short README?
If the answer is no, the agent may still call the tools. It just will not do so reliably.
Where this fits infrastructure work
A VPS API is a good example because the same platform can expose read-only health data, cost-incurring purchases, and destructive server actions. Grouping those capabilities by task and risk makes the agent more useful and the operator’s review process simpler.
TovaHub’s remote MCP endpoint is one implementation of this approach: the public guide exposes a member-scoped token and API/MCP documentation for server, metric, snapshot, network, and order workflows. If you are building a similar integration, start with the smallest read-only tool surface, test it against real tasks, and add write actions only after the audit and confirmation model is clear.
TovaHub is our product. The link is included here because the article uses its MCP surface as a concrete example, not as a substitute for the general design guidance.

