Skip to main content
Glama
dalnaspdal

omniventure-agent-tools

by dalnaspdal

repair_json

Repairs malformed JSON emitted by LLMs by stripping markdown code blocks, single quotes, trailing commas, and Python literals to yield valid RFC 8259 JSON.

Instructions

Universal LLM JSON repair and syntax sanitizer. Fixes malformed JSON emitted by LLMs (stripping markdown code blocks, single quotes, trailing commas, and Python literals like True/False/None) into valid RFC 8259 JSON in sub-millisecond edge time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
raw_jsonYesMalformed or broken JSON string to repair.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are present, so the description carries the full disclosure burden. It does disclose the exact repair behaviors (code fences, single quotes, trailing commas, Python literals) and a performance claim, but it is silent on the critical failure mode: what happens when the input cannot be repaired (throw, return original, return null). For a tool whose inputs are by definition malformed, this is a meaningful gap.

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?

Two sentences with the purpose front-loaded in the first line; the second sentence adds concrete specifics and the output standard. Efficient overall, though the 'sub-millisecond edge time' performance claim is the least decision-relevant detail and is slightly awkward phrasing.

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 one-parameter tool the description covers purpose, transformations, and the output standard, but with no output schema and no statement about error or fallback behavior, the agent is left guessing about the return shape and unrepairable-input handling. The phrase 'into valid RFC 8259 JSON' hints the output is a string, but it is not explicit.

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

Parameters4/5

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

Schema coverage is 100% for the single parameter raw_json, so the baseline is 3. The description adds genuine domain context beyond the schema's minimal 'Malformed or broken JSON string' by specifying the expected malformation classes (LLM artifacts like code fences, single quotes, Python literals), which helps an agent decide whether its input qualifies for this tool.

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 names a clear verb+resource pair (repairs/fixes malformed JSON) and enumerates the specific transformations: stripping markdown code blocks, single quotes, trailing commas, and Python literals, with a compliance target of RFC 8259. None of the sibling tools (extract_markdown, lookup_ip, sanitize_pii, distill_context, verify_email) overlap with JSON repair, so it naturally stands apart.

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 phrase 'emitted by LLMs' establishes the intended input source, so an agent can infer the use case, but the description never explicitly states when to use this tool or when not to (e.g., input that is already valid JSON or non-JSON text). No alternative is named, though the siblings are all non-overlapping, so routing confusion is low.

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