Skip to main content
Glama

Agent Data Hub

Validate JSON against a JSON Schema

util_json_validate
Read-onlyIdempotent

Check that JSON (e.g. an LLM's structured output or an API payload) is valid JSON and matches a JSON Schema. Returns valid true/false and every error with its JSON pointer path, keyword and a plain message (missing required property, wrong type, pattern, enum, min/max, format email/uri/date-time/uuid/ipv4, additionalProperties, $ref to #/$defs, allOf/anyOf/oneOf/not, if/then/else). Use before passing generated JSON downstream; feed the errors back to the model to repair it. Price: $0.001 per call (USDC on Base via x402); the first 10 calls per day are free.

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": {
      "data": "<data>",
      "schema": "<schema>"
    },
    "name": "util_json_validate"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesThe JSON to check, as a JSON string
schemaYesThe JSON Schema, as a JSON string

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: it discloses the return shape (valid true/false plus every error with JSON pointer path, keyword, and plain message), enumerates the supported schema keywords and formats, and states pricing and quota ($0.001/call, first 10/day free). These are exactly the operational facts annotations cannot carry and there is no output schema to convey them.

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?

Front-loaded with the core action, then return shape, then usage advice, then pricing — a sensible order with almost no waste. The parenthetical keyword list is long and slightly dense, but each item signals real supported functionality rather than filler.

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?

For a two-parameter, no-output-schema validation tool, everything an agent needs is present: what is validated, what the response contains, which schema features work, and the cost model. Nothing material is left to guesswork.

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 the schema already explains that both 'data' and 'schema' are JSON strings. The description adds no format detail beyond that (e.g. whether schema may be a $ref-only document), so this sits at the baseline for a fully documented schema.

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 precise verb and resource: checks that JSON is syntactically valid and conforms to a JSON Schema, naming concrete examples (LLM structured output, API payload). No sibling in the list does schema validation, so it is unambiguously distinguishable from validate_phone/validate_security_id.

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 an explicit when-to-use context ('Use before passing generated JSON downstream; feed the errors back to the model to repair it'), which is actionable for an agent in a generation pipeline. It does not name when-not-to-use or an alternative tool, but none of the listed siblings compete for this role.

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