Skip to main content
Glama

Caelara Labs Agent Safety

json_auto_repair

Repair malformed JSON from LLM output

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

Input Schema

NameRequiredDescriptionDefault
textYesMalformed JSON text

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations at all, the description carries the full behavior burden and does not meet it. It does not say whether repair is best-effort, whether unrepairable input raises an error or passes through unchanged, whether the fix can be lossy (e.g., truncating or dropping fields), or what the output looks like.

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 front-loaded sentence with no filler or redundancy. It is tight, though the brevity edges into under-specification given the tool's transform semantics.

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

Completeness2/5

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

No output schema exists, so the description is responsible for explaining what comes back, and it says nothing about the return value or failure mode. For a repair/transform tool with zero annotations, that leaves the agent unable to predict success, error, or output shape.

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?

There is a single required parameter whose schema description ('Malformed JSON text') covers 100% of the surface, so the baseline is 3. The description contributes no additional meaning about input format, size limits, or whether the input may be partially valid.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Repair') and resource ('malformed JSON'), plus a scope qualifier ('from LLM output') that separates it from generic JSON handling. It does not explicitly differentiate from siblings like schema_enforcer or agent_output_validator, which also touch malformed model output.

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?

The scope phrase 'from LLM output' implies when to reach for it (post-model-output cleanup), but there is no explicit when-to-use, when-not-to-use, or named alternative. An agent must infer that this is the repair step rather than the validation step.

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