What is JSON Schema?
JSON Schema is a standard vocabulary for describing the structure of JSON data, types, required fields, and constraints, so it can be validated automatically; MCP uses it to define tool inputs and outputs.
JSON Schema is a declarative way to describe what valid JSON looks like: which fields a object has, their types, which are required, allowed enum values, numeric ranges, string patterns, and nested shapes. Rather than checking these rules by hand, you write a schema once and a validator enforces it, and tooling can also use it to generate forms, documentation, and types. It is foundational to the Model Context Protocol, where every tool advertises an inputSchema (and optionally an outputSchema) as JSON Schema. That contract is what lets a host present a tool's parameters to the model correctly and validate the arguments the model produces before the call runs, and it is how function calling across LLM providers describes the shape of tool arguments in general. JSON Schema also underpins structured output: a tool that declares an output schema gives the agent a typed result it can rely on instead of parsing prose. In practice developers rarely hand-write these schemas; they define types in a library like Zod and emit JSON Schema from them, keeping one source of truth for both runtime validation and the MCP-facing contract.