An MCP tool should name one operation someone can review, validate its input on the server, and return results that distinguish no records, denied access, partial data and failure. Annotations such as readOnlyHint are hints that clients must not trust by default, so enforcement belongs in the service. Under the July 28, 2026 specification a broken response stream means the client reissues the call as a new request, so any write can arrive twice and needs an idempotency design. Treat descriptions as versioned code.
A complete example to argue with
Tool advice tends to stay abstract, so here is a full contract for a synthetic metric tool. Compared with most tools in the wild, three things stand out. The input is closed, so a model cannot invent a parameter that gets silently ignored. The description tells the model when to use it and when to use something else. And the output schema makes outcome a required field, which forces every code path to say what happened.
The specification allows any JSON value in structuredContent as long as it conforms to outputSchema, and it requires servers to conform when a schema is declared. For backward compatibility it advises also returning serialized JSON in a text block. The model typically reads the text and your client code reads the structure, so keep them in step by generating one from the other.
{
"name": "metrics.get_value",
"title": "Get an approved metric",
"description": "Returns one approved metric for a period, as the signed-in user. Use list_metrics first if unsure of the name. For questions no approved metric covers, use ask. Omitting period is an error; no default is applied.",
"annotations": { "readOnlyHint": true, "openWorldHint": false },
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": ["metric", "period_start", "period_end"],
"properties": {
"metric": { "type": "string", "maxLength": 128 },
"period_start": { "type": "string", "format": "date" },
"period_end": { "type": "string", "format": "date" },
"group_by": { "type": "array", "maxItems": 3, "items": { "type": "string" } }
}
},
"outputSchema": {
"type": "object",
"required": ["outcome"],
"properties": {
"outcome": { "enum": ["ok", "no_records", "partial", "not_permitted", "not_defined"] },
"rows": { "type": "array" },
"definition": { "type": "string" },
"answered_as": { "type": "string" },
"not_included": { "type": "array", "items": { "type": "string" } }
}
}
}Size: one review, one purpose
The right granularity is the one a reviewer can reason about and a model can choose correctly. Exposing hundreds of raw operations widens the review surface and costs context, since definitions are sent to the model. Anthropic’s guidance favors consolidating multi-step operations into single calls, and clear parameter names such as user_id over user. Tool names should be unique within a server and contain only letters, digits, underscore, hyphen and dot. Clients that aggregate servers may need to prefix names, so a bare search tool is asking for a collision.
A generic tool that accepts arbitrary queries against everything has a very small schema and a very large contract, because all its behavior lives in what the query might do. Judge size by how many distinct consequences a single call can have. Also return tools from tools/list in a deterministic order. The specification now asks for this because it enables client caching and improves prompt cache hits.
Five outcomes that must not look alike
Most tools fail here. An empty array can mean nothing matched, access was denied, the source was down, or the filter value was misspelled. A model reading it will often report zero. The specification gives you separate channels, and you need one more distinction of your own, because a successful call may still be incomplete.
Protocol errors are for problems with the request itself, such as an unknown tool. The spec notes that models are less likely to recover from those. Execution errors go in the result with isError true, and clients should show them to the model so it can correct itself. So write them as instructions: state the valid range and today’s date, and leave out the stack trace. The newer input_required result fits a missing choice that a person must make. Note the rule that a server must not send an elicitation request to a client that has not declared support for it.
Annotations enforce nothing
The schema reference describes every annotation as a hint, and states that clients should never make tool use decisions based on annotations from untrusted servers. So a readOnlyHint on a tool does nothing to stop it writing. Set the annotations accurately because clients use them to decide when to ask for confirmation, and put the real restriction in the database role or the API scope.
The defaults catch people out. Omit annotations and readOnlyHint defaults to false, destructiveHint to true, idempotentHint to false, and openWorldHint to true. So an unannotated read tool presents itself as possibly destructive and open-world, and a careful client may prompt on every call. Look here first when users complain about confirmation fatigue. Note too that destructive and idempotent hints only mean something when the tool is not read-only.
A timeout means you don’t know
The current revision removed stream resumption. When a response stream breaks, the in-flight request is lost and the client must reissue it as a new request with a new ID. The server cannot tell, from the protocol alone, that this is a retry. Consider a tool that creates a credit memo, where the source commits and the connection then drops. The client retries, and you now have two credit memos. Closing the stream also signals cancellation, and a server told to stop may have already committed, so a cancelled call is not proof that nothing happened.
Handle this in the contract. Have the caller supply an idempotency key as a tool argument, and store the outcome against the key. Stripe’s API is a well-documented model: it saves the status and body of the first request for a key, returns that saved response on retries, and rejects a reuse with different parameters. If the source API has no such feature, the adapter needs a lookup, such as searching for a record bearing the key before creating another. If neither is possible, say so in the description and require a person to verify before any retry.
Classify each tool on this grid, and design away the bottom-right cell.
Inputs: distrust everything, including your own schema
A descriptive schema helps the model. It protects nothing, because the client decides whether to validate, so validate again on the server. The specification lists validating all tool inputs, access control, rate limiting and output sanitization as server duties. Some specifics that catch teams out:
- Defaults that carry meaningIf an omitted period means the current fiscal quarter, then the tool has made a business decision. Either require the field, or echo the applied value in the result.
- Identifiers as claimsAn account ID in the arguments is something to authorize, and passing a format check says nothing about whether this person may see it.
- HandlesBecause MCP has no session, cross-call state uses handles passed as arguments. The specification says a handle is a name and not a capability, and that the server should check authorization against it on every call. State the expiry in the description, and return a clear execution error when one lapses.
- Mirrored headersx-mcp-header copies an argument into an HTTP header so gateways can route on it. Header values are visible to intermediaries, so never mark sensitive parameters, and remember that a customer ID in a header is customer data in your proxy logs.
- Free text that reaches a queryParameterize it. Output of a model is untrusted input by the same reasoning as any other form field.
Outputs are also an input
Whatever you return goes into a model’s context, so a result has two readers. Return the source, period, population and coverage with the values. Anthropic’s guidance suggests pagination, filtering and truncation with sensible defaults, and error messages that steer toward a narrower call. It also suggests a response format option so agents can ask for concise or detailed output while still retrieving IDs when a follow-up call needs them.
Keep narrative separate from facts where you can, so that a client can check one against the other. Omit credentials, debug detail and personal fields the task does not need. If a returned field holds text written by outsiders, such as a ticket description, label it as content. A model may otherwise read it as instructions, and OWASP treats that as a form of prompt injection with no complete fix.
Descriptions are behavior, so version them
Editing a description can change which tool a model selects as much as a code change can. Keep descriptions in version control, require review, and run your tool-selection evaluation when they change. There is a security reason as well: Invariant Labs documented tool poisoning through descriptions and rug pulls, where a description changes after approval. A disciplined server makes its own changes easy to audit, and that helps careful clients pin what they approved.
Changing a field’s meaning while keeping its name breaks consumers invisibly. Add a new field or a new tool, then retire the old one with notice. Put valid, invalid, empty, denied and partial examples in the documentation, and run those same examples as contract tests, so the written reference cannot drift from the service. Review the examples with the source owner before implementing, since that settles business meaning early and costs almost nothing.
Before you add another abstraction
If Nexatron is part of your setup, compare any proposed tool with what our hosted server already offers. The public tools include ask, query_metric for approved definitions only, list_metrics, explain_metric, compare_metric_across_sources, list_sources, audit and action tools, and no action scope comes by default. The reference at docs.nexatron.io/integrations/mcp-reference lists each tool’s annotations and errors, so hold it to the checklist you use on your own.
Claude is a trademark of Anthropic, PBC.
Bring three business questions
Explore your sources, definitions, and review criteria with our team. Please keep credentials and sensitive records out of the inquiry.