part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
Tools are the highest-risk primitive and the one that requires the most governance: the model discovers and invokes them. This lesson covers the full 2026-07-28 contract.
Model-controlled. Normative warning: there SHOULD always be a human in the loop able to deny invocations; applications SHOULD show which tools are exposed to the model, indicate visually when they are invoked and ask for confirmation.
{ "capabilities": { "tools": { "listChanged": true } } }
A server that declares tools MUST respond to tools/list with the set available to the requesting client. That set MAY be empty and change over time, but MUST NOT vary by connection or as a side effect of other requests; it MAY vary by the authorisation presented. It SHOULD be returned in deterministic order (this improves the client's cache and the LLM's prompt cache).
tools/listPageable and cacheable. Result: tools[], nextCursor?, ttlMs, cacheScope.
tools/call{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "get_weather", "arguments": { "location": "New York" } } }
Result CallToolResult: content[], structuredContent?, isError?. Supports input_required (MRTR); the retry carries inputResponses and requestState and a different id.
notifications/tools/list_changedOnly to clients with a subscriptions/listen that has toolsListChanged: true; a server that declared listChanged SHOULD send it when the list changes.
Tool object| Field | Notes |
|---|---|
name |
Unique identifier within the server. |
title |
Display name. |
description |
Text for the model. |
icons |
See 3.5. |
inputSchema |
Object JSON Schema, MUST be valid (not null). No parameters: { "type": "object", "additionalProperties": false } (recommended) or { "type": "object" }. Properties MAY carry x-mcp-header. |
outputSchema |
Optional. If present, the server MUST return a conforming structuredContent and the client SHOULD validate it. |
annotations |
title, readOnlyHint, destructiveHint, idempotentHint, openWorldHint. MUST be considered untrusted except from trusted servers. |
_meta |
Metadata (e.g. ui.resourceUri in MCP Apps). |
SHOULD: 1–128 characters; case-sensitive; only A-Z a-z 0-9 _ - .; no spaces or commas; unique per server. Examples: getUser, DATA_EXPORT_v2, admin.tools.list. Uniqueness is per server; aggregators SHOULD disambiguate (server prefix) and SHOULD NOT rely on serverInfo.name.
x-mcp-headerSee 6.2. Servers SHOULD NOT mark sensitive parameters (passwords, API keys, tokens, PII): headers are visible to intermediaries.
content[])text, image (base64 + mimeType), audio, resource_link (URI + metadata; it need not appear in resources/list), embedded resource (uri, mimeType, text or blob). All of them accept annotations (audience, priority, lastModified). Servers that embed resources SHOULD declare resources.
structuredContent: any JSON value conforming to outputSchema. For backwards compatibility, it SHOULD be duplicated, serialised, in a text block. It bears no relation to LLM structured outputs.
| Type | Examples | How it travels | To the model |
|---|---|---|---|
| Protocol error | Unknown tool, malformed request, server error | JSON-RPC error (-32602, -32603) |
Client MAY pass it on; hardly recoverable |
| Execution error | API failure, input validation (date in the wrong format), business logic | result with isError: true and explanatory content |
Client SHOULD pass it on so the model can self-correct |
Without sessions, state between calls is modelled with a handle returned by a creation tool and accepted as an argument by subsequent ones. Considerations: per-call authorisation (a handle is a name, not a capability; on servers without authentication it is a bearer and needs entropy and expiry), opacity, lifetime declared in the description, a clear execution error when it expires.
Servers MUST: validate inputs, access control, rate limiting, sanitise outputs. Clients SHOULD: confirm sensitive operations, show inputs to the user before sending, validate results before passing them to the LLM, follow the $ref rules, timeouts, audit log.
x-mcp-header.arguments against inputSchema; apply policy based on annotations without trusting them (e.g. require confirmation even with readOnlyHint: true if the server is not trusted); rate limiting per tool, user and server.structuredContent; filter or truncate content; treat resource_link and embedded resources as untrusted data; log isError.1. How must a validation error in a tool's arguments be reported?
SEP-1303: validation errors are execution errors so that the model can self-correct.
2. How reliable are a tool's annotations?
Clients MUST consider them untrusted except from trusted servers.
3. Can tools/list vary between two connections from the same client with the same token?
It can only vary by authorisation or over time (and then a notification is sent).
4. Where must an aggregator disambiguate colliding tool names?
Uniqueness is per server and serverInfo.name is not unique.