Skip to main content
Glama

mechacut

json_coerce

Repair tool-call ARGUMENTS a strict reader rejects, per a declared flat schema, WITHOUT guessing: 8.0 -> 8 in an integer slot (the published magpie #3152 serde class: 'invalid type: floating point 2500.0, expected u64' — measured 11/11 turns), exponents and real fractions LEFT AS WRITTEN (the fix's own scope), quoted 'false' refused BY NAME (the PraisonAI #6369 truthy trap), string->number only with cast_strings='on', '007' NEVER cast (leading zeros are payload: phone, CNPJ, SIREN), duplicate keys refused, bounds named (u64|i64|u32|i32). Output preserves the literal notation: coerced_text re-emits 1.0e3 as 1.0e3. strict='true' turns refusals into the 400 repair prompt. Free.

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": {
      "raw": "<raw>",
      "schema": "<schema>"
    },
    "name": "json_coerce"
  }
}

Input Schema

NameRequiredDescriptionDefault
rawYesthe exact JSON text of the tool-call arguments, e.g. '{"limit": 8.0}'
schemaYes{key: type} over integer|u64|i64|u32|i32|number|string|boolean|array<those}
strictNooff
cast_stringsNooff

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/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 behavioral burden and discloses many specifics: 8.0 becomes 8 in integer slots, exponents and real fractions are left as written, quoted 'false' is refused, string-to-number coercion only with cast_strings='on', '007' is never cast, duplicate keys are refused, and bounds are named. It also explains output notation preservation. It does not explicitly state that the tool is side-effect-free/read-only, though 'Free' hints at that.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The information is front-loaded with the core purpose, but the description is a single dense sentence packed with em-dashes, issue references, and parenthetical evidence. It is not repetitive, but the structure is poor and the issue numbers and measurement asides make it harder to parse than necessary.

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?

The tool has moderate complexity with four parameters and no output schema or annotations; the description covers the main behavior, edge cases, output preservation, and strict-mode behavior. It leaves some gaps around the exact refusal/error format when strict is off and does not explicitly state side-effect or authorization characteristics.

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 description coverage is 50%, so the description must compensate. It adds meaning for raw, schema, strict, and cast_strings beyond the schema: raw is the exact JSON text, schema is a flat key-to-type mapping, strict='true' converts refusals into a 400 repair prompt, and cast_strings='on' enables string-to-number casting with the '007' exception. It does not fully distinguish the enum synonyms on/true versus off/false.

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?

The description states a specific verb and resource: repair tool-call arguments that a strict reader rejects, per a declared flat schema, without guessing. It is clear what the tool does, though it does not explicitly differentiate itself from the sibling json_repair tool.

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?

It gives clear usage context: invoke when a strict reader rejects arguments because of type mismatches such as floating-point values in integer slots, truthy strings, or castable strings. It also states strict='true' behavior but does not explicitly name when not to use it or name alternatives such as json_repair or validate_json.

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.