Skip to main content
Glama

heal_json

Repair malformed LLM/JSON output (trailing commas, unquoted keys, markdown fences) into valid JSON.

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": {
      "raw": "<raw>"
    },
    "name": "heal_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
rawYesMalformed JSON or LLM output string
extract_modeNo
coercion_modeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it only discloses the input-side defects it fixes. It says nothing about what happens when repair is impossible (throw, return null, return best-effort), whether aggressive coercion can silently change values, or how extract_mode changes results — all material risks for a tool that rewrites data.

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?

A single tight sentence, front-loaded with the verb and resource, with the parenthetical examples earning their place. It is appropriately sized, though it leaves no room for the parameter guidance the definition otherwise lacks.

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 pure string-to-string transformer with no output schema, the core promise is adequately stated, but the unannounced semantics of the two enum modes and the undefined failure behavior leave real gaps. An agent knows what the tool does but not how to configure it or what it gets back on a bad input.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 33%: only "raw" is documented, while the two enum parameters (extract_mode with best/first/last, coercion_mode with safe/aggressive) have no descriptions in the schema or the description. The description mentions LLM output generically but adds no meaning to these switches, which materially change behavior and are the main thing an agent must get right.

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 pairs a specific verb ("Repair") with a specific resource ("malformed LLM/JSON output") and names concrete defect classes (trailing commas, unquoted keys, markdown fences), so the transformation performed is unambiguous. None of the siblings (generate_svg_qr, parse_user_agent, redact_pii, validate_email) do anything similar, so confusion is unlikely even without an explicit comparison.

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 rather than stated: an agent can infer it should call this when it holds malformed JSON or raw LLM text, but the description never says when not to use it (e.g. already-valid JSON), nor how it relates to any sibling. No prerequisites or failure-path guidance are given.

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