Skip to main content
Glama

ai_json_repair

Read-only

Repair malformed JSON — Fix broken or invalid JSON (trailing commas, bad quotes, truncation) into valid JSON using Workers AI. Pass ?text= with the malformed JSON (URL-encoded). Price: $0.006 USDC (Base, via x402).

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": "ai_json_repair"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesthe malformed JSON string to repair

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, so safety is covered; the description adds real context beyond that — it discloses the Workers AI backend (implying non-deterministic LLM repair) and an explicit per-call price of $0.006 USDC via x402 on Base, which is a payment precondition the agent must know. It stops short of describing failure behavior for unrepairable input.

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?

Compact and front-loaded: purpose, examples, invocation, then cost. Every clause carries information, though the '?text=' query syntax interleaved with the JSON-object schema is mildly jarring in an otherwise clean one-pass read.

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?

For a one-parameter tool with no output schema, the definition covers purpose, input encoding, backend, and cost. The main omission is what the response looks like and what happens on unrecoverable input, but the essentials for correct invocation are present.

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?

With 100% schema coverage and a single required parameter, the schema baseline is already 3; the description adds the non-obvious requirement that the value must be URL-encoded and be passed as '?text='. The query-string phrasing sits slightly awkwardly against the object schema but conveys a real transport constraint.

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 and resource ('Repair malformed JSON') and enumerates concrete failure modes it handles (trailing commas, bad quotes, truncation). This is unambiguous against the sibling set, none of which overlap with JSON repair.

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?

Usage is implied by the purpose: call it when you have broken or invalid JSON. There is no explicit when-not guidance, no mention of what happens if the input cannot be repaired, and no named alternative for already-valid JSON.

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