All Agent Engineering

Define MCP tool call inputs, results and human control

Use the 2025-06-18 Tools page to write a contract covering input schema, two error kinds and pre-call review.

AINavWritten / Updated
On this page

At a glance

This note addresses one concrete task: a server exposes a tool, a client calls it, and both sides need a contract that states inputs, results, errors and human control. Its only basis is the supplied Tools page of the 2025-06-18 specification. The page says tools are model-controlled, yet for trust and safety there should always be a human who can deny an invocation. The procedure below turns those statements into contract entries that can be checked one by one.

Runtime and applicability

Article type
Engineering practice
Verified
Applies to
  • MCP Define MCP tool call inputs, results and human control

Execution locations and responsibilities

  • MCP client and server Use the workflow below to distinguish responsibilities of the caller, runtime, and external actions.
Engineering workflow order
Engineering workflow order1. Confirm the server declaration and tool definitions → 2. Write the input schema and assign validation duties → 3. Design the human review before a call → 4. Define the call and result shape → 5. Separate protocol errors from tool execution errors → 6. Check output handling and audit. Arrows show the order of checks in the guide. Follow each step’s prerequisites, branches and stop conditions; unexecuted steps are not completed work.1. Confirm the server declaration and tool definitions2. Write the input schema and assign validation duties3. Design the human review before a call4. Define the call and result shape5. Separate protocol errors from tool execution errors6. Check output handling and audit

Arrows show the order of checks in the guide. Follow each step’s prerequisites, branches and stop conditions; unexecuted steps are not completed work.

When to use

  • The server must declare the tools capability, and listChanged states whether it sends a notification when the tool list changes. Each tool has a unique name, an optional title, a description and an inputSchema, plus an optional outputSchema and annotations. Clients must treat annotations as untrusted unless they come from a trusted server.

When not to use

  • This contract covers the definition, call, result and errors of a single tool; it does not handle tools/list pagination cursors, resource subscriptions or prompts.
  • The specification only says a human should be able to deny calls and gives no required interface form or list of sensitive operations, so the team must decide what counts as sensitive for each tool from its real effects.
  • The page sets no rate-limit values, timeout lengths or log format; those are implementation choices and must not be cited as specification content.

Prerequisites and input

  • The server has decided which tools to expose and can say which external system each tool touches.
  • The client has an interface that shows call details to the user and lets them refuse, or it is clear which component owns that interface.

Engineering checks

Definition layer — The server must declare the tools capability, and listChanged states whether it sends a notification when the tool list changes. Each tool has a unique name, an optional title, a description and an inputSchema, plus an optional outputSchema and annotations. Clients must treat annotations as untrusted unless they come from a trusted server.

Pre-call review layer — The specification recommends that a human can always deny a tool invocation: the interface should make clear which tools are exposed to the model, show visible indicators when tools are invoked, and present confirmation prompts. Clients should also show tool inputs to the user before calling the server, to avoid malicious or accidental data exfiltration, and ask for confirmation on sensitive operations.

Result and error layer — Results are either unstructured content (text, image, audio, resource links, embedded resources) or structured structuredContent. When an outputSchema is provided, the server must return structured results that conform to it and clients should validate them. Errors fall into two kinds: protocol errors use JSON-RPC errors, while tool execution errors are returned in the result with isError set to true.

1. Confirm the server declaration and tool definitions

Where: the server initialization response and its tools/list response. Input: the server capability declaration and the tool definitions. Action: confirm tools is declared, then check each tool for a unique name, a human-readable description and an inputSchema. Completion check: the contract table lists, for each tool, its name, description, input fields and which fields are required. Stop condition: if the tools declaration is missing, or a tool has no inputSchema, that tool does not proceed to later steps.

2. Write the input schema and assign validation duties

Where: the server tool implementation and the client pre-call checks. Input: each tool fields, types, required flags and descriptions. Action: describe parameters in JSON Schema; the server must validate all tool inputs and apply access controls and rate limiting. Completion check: every field has a type and description, required fields are listed in required, and access control and rate limiting each have an owner. Stop condition: if some parameter cannot be described by the schema and has no server-side validation, hold that tool back from release.

3. Design the human review before a call

Where: the client interface. Input: the tool name and arguments the model wants to send in a tools/call. Action: before sending, show the user the tool name and the input, require confirmation for sensitive operations, and make sure the user can refuse. Treat tool annotations as untrusted hints and do not auto-approve based on them. Completion check: the contract records which operations need confirmation and that a refusal means no request is sent. Stop condition: if the user refuses, or the tool comes from an untrusted server and approval would rely on its annotations, do not send the call.

4. Define the call and result shape

Where: the request and response of tools/call. Input: the tool name, arguments and the server choice of result types. Action: decide whether the result uses content or structuredContent; if a structured result is returned, also place the serialized JSON in a text block for compatibility, validate structuredContent against outputSchema when provided; the compatibility TextContent carries serialized JSON and its wrapper is not itself validated against that output schema. Completion check: each tool contract names its result type, and the client validates results that have a schema. Stop condition: if a structured result does not conform to the outputSchema, the client should not pass it to the model as a valid result.

5. Separate protocol errors from tool execution errors

Where: the JSON-RPC error field and the isError flag in results. Input: cases such as unknown tools, invalid arguments, server errors, external API failures and business logic errors. Action: assign a reporting path to each case: unknown tools and similar problems go through protocol errors, while API failures, invalid input data and business errors go into a result with isError set to true. Completion check: each failure in the contract falls into exactly one class and the client handles both classes. Stop condition: if a failure cannot be classified, or the client treats both classes as one, return to the definition and fill the gap.

6. Check output handling and audit

Where: the server output stage and the client result-handling stage. Input: the content items a tool returns. Action: the server sanitizes outputs; before handing results to the model the client validates them, sets timeouts for tool calls, and logs tool usage for audit. Completion check: the contract names an owner for each of output sanitizing, result validation, timeouts and logging. Stop condition: if any of the four has no owner, the acceptance fails.

Task example

This is an invented manual walkthrough; the observations are hypothetical expectations, not verification that was run. Imagine a server tool that looks up weather by city, with an inputSchema containing one required string, location. When the model wants to call it, the client is expected to show the tool name and the location value first, and send tools/call only after the user confirms. If the server is expected to report a rate-limit failure from its upstream API, it belongs in the result with isError set to true; if the model asks for a tool that does not exist, a protocol error is expected instead. If the tool declares an outputSchema, the reviewer checks that the returned structuredContent conforms to it.

Completion checks

  • Each tool has a unique name and an inputSchema, and the contract says who validates input and who handles access control and rate limiting.
  • The path that shows inputs and lets the user refuse is written down and does not rely on untrusted annotations.
  • Every failure maps to either a protocol error or a tool execution error with isError true, and owners for result validation and audit are named.

Verification scope

Only the supplied Tools page of the MCP 2025-06-18 specification was read as documentation. Installation, login, API execution and output were not tested; the example is an invented walkthrough and does not describe any product actual behavior. That version is the one read here and is not claimed to be the newest.

Sources

All links are official pages; verification dates are listed per source, and links point to the version checked.

  1. MCP · MCP documentation: mcp-tools

Found an error? Tell us →