Skip to main content
Glama

API Router

json_repair

Read-only

Repair broken or LLM-produced JSON (code fences, comments, trailing commas, single quotes, bare keys, truncation) and optionally validate against a JSON Schema subset. Free, deterministic.

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
textYes
schemaNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already state readOnlyHint=true and openWorldHint=false, and the description adds useful behavioral context with 'Free, deterministic' and the 'JSON Schema subset' limitation. However, it does not explain what happens when input cannot be repaired or how validation failures are surfaced, which matters for a tool with no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the core repair operation and supported breakage types come first, followed by optional validation and behavioral notes. Every phrase adds concrete information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter repair tool with no output schema, the description covers the main operation and examples well. It remains incomplete about return shape and failure behavior, especially whether schema validation produces an error, a boolean, or annotated output.

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 description coverage is 0%, so the description must carry parameter meaning. It implies that the required input is the broken JSON text and that the optional parameter is a JSON Schema subset used for validation, but it does not clarify supported schema keywords or how validation affects the result.

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?

The description states a specific verb and resource ('Repair ... JSON') and enumerates the exact failure modes handled: code fences, comments, trailing commas, single quotes, bare keys, and truncation. It also distinguishes an optional validation mode, so an agent can identify the tool's function 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?

It clearly indicates when the tool applies: broken or LLM-produced JSON, with optional schema validation. It does not state explicit exclusions or compare against alternatives, but the usage context is strong enough for this narrowly scoped utility.

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.