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.
MCP uses JSON Schema to describe tool arguments (inputSchema), their structured results (outputSchema) and elicitation forms (requestedSchema). You do not need to be an expert in all of JSON Schema, but you do in the part your validator will run thousands of times a day over schemas written by third parties.
$schema$schema)."$schema": "http://json-schema.org/draft-07/schema#".items only describes homogeneous elements and the tuple form moves to prefixItems; definitions becomes $defs; $ref can coexist with other keywords in the same object (in draft-07 it overrode them); new vocabulary unevaluatedProperties/unevaluatedItems; dependencies is split into dependentRequired and dependentSchemas.| Group | Keywords | Notes |
|---|---|---|
| Type | type (string, number, integer, boolean, object, array, null) |
Can be an array of types. |
| Objects | properties, required, additionalProperties, patternProperties, minProperties, maxProperties |
additionalProperties: false closes the object. |
| Arrays | items, prefixItems, minItems, maxItems, uniqueItems, contains |
|
| Strings | minLength, maxLength, pattern, format |
format is an annotation by default; validating it is optional unless the validator enables it. |
| Numbers | minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf |
In 2020-12 the exclusive* keywords are numeric, not boolean. |
| Values | enum, const, default |
default is an annotation; MCP uses it in elicitation to pre-fill. |
| Composition | allOf, anyOf, oneOf, not, if/then/else |
Exponential cost in the worst case. |
| References | $ref, $defs, $id, $anchor |
$ref to a network URI: resolving it is forbidden by default in MCP. |
| Annotations | title, description, examples, deprecated, readOnly |
description reaches the model: it is an injection surface. |
x-mcp-header inside inputSchema properties (lesson 6.2). JSON Schema ignores unknown keywords, so it is valid in any dialect.structuredContent may be any JSON value conforming to outputSchema (not only an object) since 2026-07-28.A schema with nested allOf, recursive $ref or catastrophic pattern can cost seconds per validation. MCP requires bounding: maximum depth, number of subschemas, time budget. Choose a validator that allows those limits and that does not resolve remote $ref by default (many do).
{
"type": "object",
"properties": {
"query": { "type": "string", "minLength": 1, "maxLength": 500, "description": "Free-text search" },
"limit": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 },
"sort": { "type": "string", "enum": ["relevance", "date"] }
},
"required": ["query"],
"additionalProperties": false
}
isError: true) so that the model can correct itself, as SEP-1303 recommends.$ref, flag schemas without additionalProperties: false, detect description fields with suspicious instructions.inputSchema/outputSchema to detect silent changes (rug pull).1. Which keyword replaces definitions in 2020-12?
2020-12 uses $defs; definitions belongs to draft-07 and earlier.
2. In 2020-12, how is a tuple of heterogeneous elements described?
The array form of items was renamed prefixItems.
3. How does MCP treat a $ref that points to a network URL?
Because of SSRF and DoS risk, network resolution is forbidden unless explicitly opted in with an allow-list and limits.