Skip to main content
Glama

TestingAPIs API tools

Validate JSON against a JSON Schema

validate_json_schema
Read-onlyIdempotent

Check a JSON document against a JSON Schema (drafts 4 to 2020-12, with $ref, allOf/anyOf/oneOf, if/then/else and formats). Returns every error with the JSONPath of the value and the keyword that failed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "schema": "<schema>",
      "data": "<data>"
    },
    "name": "validate_json_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesThe JSON document to check, as JSON text.
schemaYesThe JSON Schema, as JSON text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world and non-destructive, so the safety profile is covered. The description adds real behavioral value beyond that by disclosing that all errors are returned (not just the first) and that each error carries a JSONPath and the failing keyword, which matters since there is no output schema. It stops short of saying what happens with malformed JSON text input.

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

Conciseness5/5

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

Two tight sentences with no filler: the capability and supported drafts come first, the return contract second. Every clause carries information an agent would otherwise have to guess.

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

Completeness4/5

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

For a two-parameter pure-function validator with annotations covering safety, the description supplies the draft range, feature coverage, and error-reporting shape. The only meaningful gap is error behavior for invalid input JSON text or an invalid schema document.

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

Parameters3/5

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

Schema description coverage is 100% and both parameters ('data' and 'schema') are documented as JSON text in the schema itself. The description adds no syntax, encoding, or size guidance beyond what the schema already states, so the baseline of 3 applies.

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

Purpose4/5

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

The description gives a specific verb and resource ('Check a JSON document against a JSON Schema') and bounds the scope with the supported draft range (4 to 2020-12) and keyword coverage ($ref, allOf/anyOf/oneOf, if/then/else, formats). That is enough to separate it from siblings like validate_openapi or generate_json_schema, though no sibling is named explicitly.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the draft and keyword list tells an agent when this tool is applicable, but there is no explicit when-to-use/when-not guidance and no pointer to an alternative such as validate_openapi for spec documents. An agent must infer the selection criteria.

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