Skip to main content
Glama

Agent Data Tools: Developer utilities

json_repair

Fix JSON as LLMs often write it: removes ```json fences and surrounding prose, comments and trailing commas, converts single quotes, quotes bare keys, maps True/False/None, and closes unclosed brackets. Returns the repaired JSON and whether it now parses. Use when an LLM's JSON output fails to parse. Costs $0.001 in USDC on Base per successful call, paid with x402.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe broken JSON text

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 declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=true, but they say nothing about cost, payment rail, or return shape. The description supplies all three — $0.001 USDC on Base per successful call via x402, and that it returns both the repaired JSON and a parse-success flag. For a paid network-dependent tool this is exactly the missing context. No contradiction with the 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 transformation list, then the when-to-use trigger, then cost — a sensible order. The defect enumeration is long but each item is a distinct capability that earns its place; still, it is a dense single sentence that could be tightened slightly.

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?

No output schema exists, yet the description states the return payload (repaired JSON plus parse boolean), and it covers the two things an agent could not infer elsewhere: the LLM-output use case and the x402 payment requirement. Nothing needed to call it correctly is missing.

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?

A single parameter with 100% schema description coverage ('The broken JSON text'), so the schema already carries the semantics; baseline for a one-param tool is 4. The description adds context about what kinds of breakage the input may contain, but no syntax or format detail beyond the 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 specific verb+resource (repair malformed JSON) and enumerates the exact defect classes it handles — code fences, prose, comments, trailing commas, single quotes, bare keys, True/False/None, unclosed brackets. An agent can distinguish this from json_format, json_minify, and json_validate purely from the description.

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 trigger condition: 'Use when an LLM's JSON output fails to parse,' which implicitly routes validation-only needs to json_validate and formatting needs to json_format. It never names those siblings outright, so the exclusion is inferable rather than stated.

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