Skip to main content
Glama

Validate JSON against a JSON Schema (repairs broken input first)

validate_json
Read-onlyIdempotent

Check JSON against a JSON Schema and get every error with its JSON Pointer path. Send the JSON either as text ("input"; broken text is repaired first, and the fixes are listed) or as an already-parsed value ("data"). Optional coerce converts "42" → 42, "true" → true, etc. toward the schema's types before validating and lists each change. A schema mismatch is a normal result (valid: false), not an error. Drafts 2020-12 (default), 2019-09, 7, 4; only local $refs. Pure computation: read-only, no network access, inputs not stored. Same engine and limits as POST /api/v1/validate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoAn already-parsed JSON value to validate. Send this or "input", not both.
draftNoJSON Schema draft. Default: from the schema's $schema, else 2020-12.
inputNoJSON text to validate (repaired first if broken). Send this or "data", not both. Max 102,400 bytes.
coerceNoConvert values toward the schema's declared types before validating: "42" → 42, "true" → true, "null" → null, 5 → "5", x → [x]. Each change is listed in coercions.
schemaYesA JSON Schema (draft 2020-12 by default; 2019-09, 7 and 4 also supported). Only local $refs (#/...) resolve; remote $refs are an error. Max 32 KB.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
jsonYesThe validated value (after repair and coercion)
planNo
draftNo
fixesNo
validYes
errorsYes
coercedNo
versionNo
repairedNotrue when "input" needed repair before validation
warningsNo
coercionsNo
errorCountYesTotal errors (at most 50 are listed); a lower bound when errorsTruncated is true
errorsTruncatedYestrue when the validator produced more than 5,000 raw errors and only the first 5,000 were examined

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds substantial context beyond the annotations: pure computation, no network access, inputs not stored, only local $refs resolve, remote $refs error, size limits, and that a schema mismatch is a normal result rather than an error. This goes well past the readOnlyHint/idempotentHint safety profile.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but front-loaded: the core action and error output come first, then input-vs-data, coerce, and limits. Every sentence carries information, though the final runtime/endpoint details add slight bulk.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given an output schema exists, the description need not explain return values, and annotations plus text cover safety, determinism, limits, and repair/coerce behavior. An agent has everything needed to call this correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the structured fields already document all five parameters. The description still adds meaning by illustrating coercion directionality ('42' → 42, 5 → '5') and noting that changes are reported in a 'coercions' list.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Check JSON against a JSON Schema') and scopes the outcome ('every error with its JSON Pointer path'). It also distinguishes itself from the sibling repair_json by framing repair as a preliminary side effect rather than the purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear selection guidance between 'input' and 'data' and explains when to use 'coerce'. It does not name repair_json explicitly as the alternative for pure-fix workflows, but the usage context is otherwise unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources