Skip to main content
Glama

repair_json

Deterministically parses and repairs malformed, truncated, or unclosed JSON strings produced by LLMs (e.g. missing closing brackets, unescaped quotes, trailing commas). Returns parsed valid JSON object. Use when an LLM produces syntax-broken JSON. Do not use on valid non-JSON prose or for modifying data values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
raw_jsonYesThe unparsed, malformed, or incomplete JSON text string requiring syntax repair into standard RFC 8259 format.

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description must carry the behavioral disclosure. It states the deterministic nature, the kinds of repairs performed, and the return type ('Returns parsed valid JSON object'). It does not cover error behavior or edge cases, but for a repair tool that guarantees a parsed object, this is reasonably transparent.

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 efficient, with the core purpose front-loaded. Every sentence adds value: the repair scope, the specific error types, the return type, and usage restrictions. There is no redundancy or fluff.

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?

Given the tool's simplicity (one parameter, no output schema, no annotations), the description covers the essential information an agent needs: what it does, when to use it, and what it returns. It could mention how it handles unresolvable JSON or whether it throws errors, but for the expected use case it is adequately complete.

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?

The input schema already has a 100%-coverage description of the single parameter (raw_json) explaining its role as malformed JSON text needing repair. The tool description adds no additional parameter-level details, so the baseline of 3 applies—schema does the heavy lifting.

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 the exact action ('parses and repairs'), the specific resource ('malformed, truncated, or unclosed JSON strings'), and the context (produced by LLMs). It clearly differentiates from siblings by focusing on repair rather than validation or extraction, and names concrete error types (missing brackets, unescaped quotes, trailing commas) that make the purpose unmistakable.

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?

The description gives explicit when-to-use ('when an LLM produces syntax-broken JSON') and clear exclusions ('do not use on valid non-JSON prose or for modifying data values'). It does not name an alternative sibling directly, but the context is sufficient for an agent to decide when this tool applies versus others.

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.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool serves a clearly distinct purpose: DNS verification, text chunking, expression evaluation, web extraction, JSON repair, and schema validation. There is no overlapping functionality, and the descriptions explicitly state boundaries (e.g., 'Do not use for' clauses) that prevent misselection.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (audit_dns, chunk_text, eval_expression, extract_web, repair_json, validate_schema). The verbs are descriptive and uniform, making the naming predictable and scannable.

Tool Count5/5

With 6 tools, the server is well-scoped for a utility server. Each tool addresses a common agent need without redundancy, and the count falls in the ideal range for easy comprehension and selection.

Completeness4/5

The tool set covers common utility gaps (DNS safety, text preparation, calculation, web content, JSON handling). Minor omissions exist, such as a dedicated string manipulation or encoding tool, but the core utilities are complete enough for most agent workflows without dead ends.

Resources