Skip to main content
Glama

Repair & validate JSON ($0.002)

weblens_json_repair

Repairs malformed JSON by fixing code fences, comments, quotes, bare keys, trailing commas, Python literals, and truncated endings, then optionally validates it against a JSON Schema.

Instructions

Fix broken JSON (code fences, comments, single quotes, bare keys, trailing commas, Python literals, cut-off endings) and optionally validate it against a JSON Schema (no regex patterns). Costs $0.002 USDC.

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": "weblens_json_repair"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe broken JSON text
schemaNoOptional JSON Schema to validate against

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does add real behavioral signal beyond structured fields: the exact pricing ($0.002 USDC) and the limitation that JSON Schema regex patterns are unsupported. It does not disclose what the tool returns (repaired text plus validation verdict?), whether it fails or best-effort-returns on unrepairable input, or what happens at the 90,000-character boundary — meaningful gaps for a paid, output-schemaless tool.

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 the action verb first, followed by a dense but genuinely informative defect list and the cost. Every clause carries information; the only mild cost is the long parenthetical, which is length that buys precision.

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 two-parameter tool with full schema coverage, the inputs are well covered, but there is no output schema, so the description should ideally state what an agent gets back — repaired string only, or repaired string plus validation errors — and how failures are signaled. That omission is the main residual gap; pricing and the regex limitation are useful additions there.

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%, so the two parameters are already documented, setting a baseline of 3. The description earns above baseline by clarifying that schema validation is optional and by adding a real semantic constraint — regex patterns are not honored — which the schema field description does not mention.

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?

States a specific verb+resource ("Fix broken JSON") and enumerates the exact failure modes handled (code fences, comments, single quotes, bare keys, trailing commas, Python literals, cut-off endings), plus the optional validation add-on. This is clearly distinguishable from siblings like weblens_csv_to_json (conversion) or weblens_extract (extraction).

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 use case is largely self-evident from the enumeration of repairable defects, and the parenthetical "(no regex patterns)" gives one concrete constraint on when validation won't work. However, there is no explicit when-to-use/when-not-to-use guidance, no statement of what happens with input that cannot be repaired, and no pointer to an alternative for the regex case.

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