Skip to main content
Glama

Agent Data Tools: Full list (every tool as its own definition)

JSON repair: fix broken JSON

json_repair
Read-only

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. Example: text=json {name: 'Ada', tags: ['x',],}

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_repair"
  }
}

Input 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 already declare readOnly and non-destructive, but the description adds real value beyond them: the exact repair operations performed, the return shape (repaired JSON plus parse status), that failed calls are free, and that repeats are charged — which explains the idempotentHint=false annotation instead of merely restating it.

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 transformation list and usage trigger are front-loaded and earn their place. The inline example containing literal code fences and the appended pricing sentence make the tail slightly cluttered, but nothing is redundant filler.

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?

A single-parameter tool with no output schema, yet the description still explains what comes back (repaired JSON plus a parse-success flag), what it does not do (changes nothing), and the cost model including free failures. Nothing an agent needs to invoke 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?

Schema coverage is 100% for the single parameter, so the baseline is 3; the description goes slightly further with a concrete malformed input example that shows the expected input form (fenced, single-quoted, trailing-comma text). That extra illustration is useful but modest.

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 JSON) and enumerates exactly what it fixes — code fences, prose, comments, trailing commas, single quotes, bare keys, True/False/None, unclosed brackets. This makes it clearly distinguishable from formatting/validation siblings without needing to name them.

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?

"Use when an LLM's JSON output fails to parse" gives an explicit trigger condition. It does not explicitly exclude alternatives such as json_validate or json_format, so the agent must infer the boundary from the failure-mode framing rather than being routed.

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.