Skip to main content
Glama
Diogenes Developer, Data & Prompt Engineering Utilities MCP

Diogenes Developer, Data & Prompt Engineering Utilities MCP

json_repair

Repairs truncated or malformed JSON strings by fixing unescaped quotes and trailing commas to restore valid, parseable data.

Instructions

Deterministically heals truncated or malformed JSON strings, unescaped quotes, and trailing commas.

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": {
      "malformed_json": "<malformed_json>"
    },
    "name": "json_repair"
  }
}

Input Schema

NameRequiredDescriptionDefault
malformed_jsonYesMalformed JSON string

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. "Deterministically" usefully signals no external calls and repeatable output, and the enumerated malformation types define repair scope, but it says nothing about what happens on input that cannot be repaired, whether errors are thrown, or what the returned value is.

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?

One sentence, front-loaded with the verb and resource, with every clause (truncation, unescaped quotes, trailing commas) earning its place by scoping the repair capability.

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?

This is a low-complexity, single-parameter tool with no output schema, so the description is nearly sufficient. However, with no output schema present, the description should still indicate what is returned or how unrecoverable input is handled, and it does neither.

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 100% for the single parameter, so the baseline is 3. The description adds only indirect meaning by naming the kinds of malformation the parameter will typically contain, but no format, size, or encoding details beyond the schema.

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 ("heals") plus resource ("JSON strings") and even enumerates the exact failure classes handled: truncation, unescaped quotes, and trailing commas. No sibling in the list (regex, schema, tabular, audit tools) overlaps, so an agent can select this unambiguously.

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 applies when it holds malformed JSON. There is no explicit when-to-use framing, no statement about unrecoverable input, and no named alternative or precondition.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.