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 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); 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.6/5.0
Behavior5/5

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

Annotations only declare read-only and open-world; the description goes well beyond them by describing the return payload (valid yes/no, per-error path, sanitized value with disallowed fields removed), the fail-loud behavior for unsupported keywords, and the exact cost model ($0.002 per successful call via x402, failures not charged). Pricing and partial-failure semantics are precisely the behavioral facts an agent cannot infer from annotations.

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 and the keyword scope, then returns, then pricing — a sensible order with no filler sentences. The parenthetical keyword list is long but each entry is genuinely informative, so the density is justified rather than padding.

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?

Although an output schema exists, the description still covers what an agent needs: supported constructs, what unsupported constructs do, what a failure result looks like, and what calling costs. Nothing material is left for the agent to infer before invoking this validator.

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 already 100%, so the baseline is 3; the description still adds real meaning by constraining what the `schema` parameter may contain (a draft 2020-12 subset) and by relating `value` to behavior (disallowed fields are stripped from the returned value). That is meaningful semantics beyond the bare 'The JSON Schema' schema text.

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') and immediately bounds the scope by naming the supported draft 2020-12 keyword set. An agent can tell exactly what kind of validation this performs without opening the schema.

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 supported-keyword list plus the explicit statement that $ref, allOf/anyOf/oneOf, if/then and format 'return an error instead of passing silently' functions as a when-not condition: if your schema uses those constructs, this tool will reject it. There is no explicit routing to an alternative tool, but no sibling appears to be a direct substitute, so the gap is minor.

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