Skip to main content
Glama

fix_json

Repair malformed or loosely formatted JSON text and return a valid JSON value.

Instructions

Repair malformed or loosely-formatted JSON text into a valid JSON value. [conductor: verified stochastic command]

Input Schema

NameRequiredDescriptionDefault
textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.1

TDQS

C2.9/5.0
Behavior2/5

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

No annotations, so the description carries the full burden. It does not say what tolerances are handled (trailing commas, single quotes, unquoted keys), what happens when repair is impossible, whether output is a string or a parsed value, or what the cryptic tag '[conductor: verified stochastic command]' implies about determinism — if anything, it hints at non-determinism without explaining it.

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 core sentence is short, front-loaded, and waste-free. The trailing bracketed conductor tag adds no actionable meaning for an agent and dilutes an otherwise tight definition.

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, no-output-schema utility the description covers the basic contract, but it leaves the failure mode and the nature of the returned value unspecified. Adequate as a minimum viable definition, not 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?

There is one parameter with 0% schema description coverage, so the description must compensate. 'JSON text' does convey that the single input is the malformed JSON string rather than a path or options object, but it says nothing about size limits, encoding, or accepted input shapes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('repair') and resource ('malformed or loosely-formatted JSON text') plus the outcome ('a valid JSON value'). It is clearly distinguishable from the sibling json_minify and json_extract, but it does not explicitly contrast with them, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this versus json_minify or json_extract, no mention of prerequisites, and no exclusions. The agent must infer that this is the tool for invalid JSON from the word 'malformed' alone.

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