Skip to main content
Glama

JSON validator: is this valid JSON

json_validator
Read-only

JSON validator: check whether a text is valid JSON and get the error position and message when it is not, plus the parsed type. Use before parsing an LLM's JSON output, saving a config or sending a request body. Example: text={"a":1}. Price $0.01/call via x402 USDC or a card key (/credits), first 25 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_validator"
  }
}

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnlyHint, destructiveHint false), and the description correctly reinforces rather than contradicts them. It adds genuinely new operational context the annotations cannot: per-call pricing via x402 USDC or card key, first 25 free, failed calls free, and that repeats are charged again (which explains idempotentHint=false). Missing only latency/rate-limit detail to reach a 5.

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?

Purpose leads, followed by the return contract, then usage, example, pricing, and safety. Every sentence carries information. Slight redundancy in echoing the title as the opening clause and in restating statelessness after the charging note, but nothing is dead weight.

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 one-parameter validation tool with no output schema, the description still spells out the return values (validity, error position, error message, parsed type) and discloses the cost model. Nothing an agent needs in order to call this correctly and budget for it is missing.

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?

There is a single required parameter with 100% schema description coverage, including the 20,000-character cap, so the schema already does the heavy lifting. The description contributes only a worked example (text={"a":1}) and no additional semantics such as encoding expectations or whether whitespace-only or primitives count as valid. Baseline 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 names a specific verb and resource ("check whether a text is valid JSON") and adds the distinctive payoff: error position, error message, and parsed type. That is far more informative than the title's tautological restatement. It loses the top mark because it never distinguishes itself from the near-identical sibling json_validate, so an agent must infer which of the two to pick.

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?

Concrete use sites are given: before parsing an LLM's JSON output, before saving a config, before sending a request body. That is a clear positive trigger rather than vague "use as needed" language. There is no when-not-to-use clause and no alternative tool named, which keeps it at 4 rather than 5.

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