Skip to main content
Glama

Agent Data Tools: Utilities

JSON validator, validate JSON: check whether text is valid JSON and where the error is

json_validate
Read-only

Check whether text is valid JSON. Returns valid true/false, the parsed value's type and size, and for invalid input the error message with line and column. Use before parsing an LLM's or an API's output. Example: text={"a":1}. Price $0.01/call via x402 USDC or a card key (/credits), first 10 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not 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": {
      "text": "<text>"
    },
    "name": "json_validate"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe JSON text to check (up to 20,000 characters)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, yet the description adds substantive context beyond them: the full return contents including error line/column, the per-call price with payment rails (x402 USDC or card key), the free-tier allowance, and the fact that failed calls are free. The note that 'each call is charged, so repeats are not free' usefully explains the idempotentHint=false annotation rather than contradicting it; only the restated 'changes nothing' overlaps the readOnly hint.

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?

The core purpose and the 'use before parsing' cue are front-loaded, and the example is compact. The pricing/payment sentence is longer than the operational content and slightly crowds the call-relevant information, but it does earn its place given the paid model.

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?

With no output schema, the description carries the burden of describing returns and does so thoroughly (validity, type, size, error message with line and column), plus cost and payment. It leaves unstated what dialect counts as valid JSON (e.g., trailing commas, leading whitespace), which is the one thing an agent might still need.

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 the single parameter already documents itself including the 20,000-character limit. The description adds only an inline example (text={"a":1}), which gives a little concreteness but no syntax or format rules, 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 states a specific verb and resource: 'Check whether text is valid JSON,' and even previews the result shape (valid flag, type, size, error line/column). It does not name the nearest sibling (json_repair, which also handles broken JSON), so the agent must infer which tool to pick when the text is invalid and needs fixing.

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?

There is one concrete usage cue: 'Use before parsing an LLM's or an API's output.' That is genuine when-to-use guidance, but there are no exclusions and no named alternative for the obvious adjacent case (invalid JSON that should be repaired rather than merely flagged).

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