What is an MCP input schema? Tool arguments explained

By

An MCP input schema describes the arguments a tool accepts. Learn how it guides agents, validates requests, and differs from permissions and output schemas.

An MCP input schema describes the arguments a tool accepts, using JSON Schema. It tells a coding agent which fields to send and which constraints those fields must satisfy.

Build an MCP server contains the full implementation, including rejected inputs from a real test run.

How an input schema works

A server includes inputSchema in the tool definition returned by tools/list. The client can pass that definition to the model before a tool call.

The MCP tools specification requires servers to validate tool inputs. Descriptions help the model choose arguments, while validation checks what actually arrives.

MCP input validation before a tool handlerThe client receives a tool schema. The model proposes arguments. The server validates them, then runs the handler or returns an input error.Tool definition andinput schemaModel proposesargumentsServer validatesargumentsValid input reacheshandlerInvalid inputreturns an error

In coding tools

Claude Code loads MCP tool definitions on demand through tool search. Codex documents tool allow and deny lists. Those settings decide which tools are available.

Cursor documents tool use and MCP logs. Grok Build exposes configured server tools alongside its built-in tools. These connection guides do not document an identical schema editor or validation interface across clients.

Details checked against each vendor’s documentation in November 2026.

A real example

The server tutorial defines search_posts with this Zod schema. Its SDK converts the definition to JSON Schema for clients:

inputSchema: z.object({
  query: z.string().trim().min(2).max(100)
    .describe('Keywords, for example "cloudflare tunnel"'),
  tag: z.string().regex(/^[a-z0-9-]+$/).max(30).optional()
    .describe('Only posts with this tag, for example "ai" or "node"'),
  limit: z.number().int().min(1).max(20).default(5)
})

The recorded test matrix rejects a one-character query and a limit of 21. It also checks that a query with no matches returns an empty list. An empty search result is a valid outcome.

FieldRole in this tool
inputSchemaChecks the query, optional tag, and result limit
outputSchemaDescribes the returned total and results
structuredContentContains the returned search data

When to use it

Inspect the schema when an agent sends the wrong field name or repeatedly gets a validation error. When building a tool, give each argument a clear description and useful bounds.

Pitfalls

A valid argument can still request data the caller cannot access. The tutorial separately filters unpublished posts before searching. Keep those access checks in the server.

Changing a required field can break clients using an older definition. Check the tool definition the client received when debugging a mismatch.

For another practical discovery interface, see CLI Tools Cabinet.

  • Tool calling: Tool calling is when a model names a function and its arguments, and the app runs it. How Claude Code, Codex, Cursor and Grok Build take that step.
  • MCP structured content: MCP structured content returns machine-readable JSON from a tool. Learn how structuredContent, outputSchema, and text blocks fit together in real calls.
  • MCP tool errors: MCP tool errors report failures inside a tool result. Learn how isError differs from a protocol error, with real validation and empty-search examples.

All AI glossary entries → · AI for coding hub →

Want me to talk about your product? You can sponsor this site.