Skip to main content
Glama

ag_json_repair

Repair malformed JSON (LLM output, logs) into parseable JSON.

Deterministically repairs almost-JSON: strips code fences and comments, converts single quotes and Python/JS literals (True/None/undefined), quotes bare keys, removes trailing commas, balances brackets. Returns the parsed value plus the exact repair steps applied. Use when a model or upstream tool emitted JSON that json.parse rejects.

Deterministic, fixture-verified, free for guests (rate-limited; pass your Guild api_key to use your member budget). Returns the result plus a Guild-signed provenance envelope.

payload MUST match this JSON Schema: {"type": "object", "properties": {"text": {"type": "string", "maxLength": 60000}}, "required": ["text"], "additionalProperties": false}

Output schema: {"type": "object", "properties": {"ok": {"type": "boolean"}, "parsed": {}, "repaired": {"type": "string"}, "changed": {"type": "boolean"}, "steps": {"type": "array", "items": {"type": "string"}}}, "required": ["ok", "parsed", "repaired", "changed", "steps"], "additionalProperties": false}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNo
payloadYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses determinism, fixture-verification, rate limits, api_key usage, and the exact repair steps. However, it claims 'Returns the result plus a Guild-signed provenance envelope,' yet the provided output schema (with additionalProperties: false) does not include such an envelope, creating a minor inconsistency.

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?

The description is relatively long but dense with useful information. It front-loads the main purpose and uses a clear flow: what it does, how to use, constraints, and return value. Including the full schemas adds length but is valuable; still, it could be tightened.

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

Completeness5/5

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

Given the output schema is provided, the description still adds essential context: use case, repair behavior, rate limits, auth, and return contents. For a tool with moderate complexity, this is comprehensive and allows an agent to select and invoke it correctly.

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

Parameters5/5

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

Schema description coverage is 0%, but the description compensates by embedding the exact JSON Schema for `payload` and explaining `api_key` ('pass your Guild api_key to use your member budget'). This fully clarifies both parameters beyond what the outer input schema offers.

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 clearly states the tool repairs malformed JSON into parseable JSON, with a specific verb ('repair') and resource ('malformed JSON'), and distinguishes it from sibling tools like json_validate and json_canonicalize by mentioning specifics like stripping code fences and fixing Python/JS literals.

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 explicitly says 'Use when a model or upstream tool emitted JSON that json.parse rejects,' giving clear usage context. It does not name alternative tools or state when not to use it, so it falls short of the highest bar.

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.1/5.0
Disambiguation4/5

Tools are grouped by prefix (ag_calc_, ag_data_, ag_json_, ag_table_, ag_text_), which helps disambiguate. However, some clusters like guild_search, guild_check, guild_risk_score, and guild_best_agent have overlapping goals (all find or evaluate agents), and guild_prove and guild_prove_verify are tightly coupled but distinct. Overall, most tools have clear purposes.

Naming Consistency4/5

The tools follow a consistent verb_noun or domain_verb pattern (e.g., ag_calc_stats, ag_data_dedupe, guild_search). The mix of ag_ and guild_ prefixes is slightly inconsistent, but within each group naming is uniform. No chaotic mixing of cases (all snake_case). Minor deduction for the split prefix.

Tool Count3/5

39 tools is on the high side for a single MCP server. While the tools are genuinely useful and cover distinct deterministic utilities plus guild trust operations, the count feels heavy. A more focused split (e.g., separate server for deterministic utilities vs. guild trust) could improve coherence.

Completeness5/5

The server covers a broad set of deterministic utilities (statistics, unit conversion, JSON, CSV, regex, date normalization) and a full trust/reputation workflow (register, search, check, risk score, escrow, attest, record, passport, verify, preflight). There are no obvious gaps: for the declared capabilities, the tool surface is comprehensive.