Skip to main content
Glama

Checks an agent's JSON output against a JSON Schema

agent_intel_agent_json_schema_guard
Read-only

Checks an agent's JSON output against a JSON Schema (draft 2020-12 keywords: type, properties, required, additionalProperties, items, enum, const, length, pattern, minimum/maximum, item counts). Returns valid yes/no, each error with its path and the value with disallowed fields removed. $ref, allOf/anyOf/oneOf, if/then and format return an error instead of passing silently. Price: $0.002 in USDC per successful call, paid with x402 (Base, Solana or Arc); failed calls are not charged.

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>",
      "value": "<value>"
    },
    "name": "agent_intel_agent_json_schema_guard"
  }
}

Input Schema

NameRequiredDescriptionDefault
valueYesThe JSON value to check (any JSON)
schemaYesThe JSON Schema

Output Schema

NameRequiredDescriptionDefault
noteNo
validNo
errorsNo
sourceNo
checkedAtNo
sanitizedNo
removedFieldsNo

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 readOnlyHint/openWorldHint: it discloses the return shape (valid yes/no, per-error path, a sanitized value with disallowed fields stripped), the fail-loud policy for unsupported keywords, and the payment model including that failed calls are not charged. That last point materially affects retry behavior, which no annotation conveys.

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 the supported-keyword list, then outputs, then pricing — a sensible order with no filler. The parenthetical keyword enumeration is long, but it is load-bearing for deciding whether the tool will accept a given schema.

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?

Despite having an output schema, the description still summarizes returns and, more importantly, covers the failure mode (unsupported keywords erroring rather than silently passing) and the x402 payment prerequisite with network options. For a two-parameter paid validation tool, an agent has everything needed to call it correctly.

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 coverage is 100% and both parameters are already described in the schema, so the baseline applies. The description adds only that the checked value may be 'any JSON' and that the schema argument is a JSON Schema — mild reinforcement rather than new semantics about format or size limits.

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 and resource: checks an agent's JSON output against a JSON Schema, then enumerates the supported draft 2020-12 keyword set. Nothing in the sibling list (citation_verifier, hallucination_claim_checker, pii_credentials_redaction) does schema validation, so the boundary is unambiguous.

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?

The phrase 'an agent's JSON output' makes the intended context clear, and the description explicitly rules out schemas using $ref, allOf/anyOf/oneOf, if/then or format — an effective when-not constraint. It does not name an alternative tool or say what to do instead when a schema uses those keywords, so it falls short of full routing guidance.

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