Skip to main content
Glama

InvokePort

JSON Repair

invokeport_json_repair
Idempotent

Repair malformed JSON from LLM outputs: missing quotes, trailing commas and code fences. Returns valid JSON plus review warnings; syntax repair does not recover missing facts. Free deterministic computation; no LLM or external fetch. Requires a scoped key allowing json-repair. Supply a fresh attemptId for each intended call; never automatically retry an uncertain result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes
attemptIdYesUnique non-secret invocation ID. Retain on uncertain outcomes; do not invent a new ID to retry.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the auth requirement (scoped key allowing json-repair), the compute profile (free, deterministic, no LLM or external fetch), the return shape (valid JSON plus review warnings), and the retry contract tied to attemptId. The 'deterministic' claim is consistent with idempotentHint=true and nothing contradicts readOnlyHint=false.

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

Conciseness5/5

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

Four dense sentences, front-loaded with the purpose and failure modes, then return behavior, then cost/auth, then the retry rule. No filler and no repetition of schema or annotation content.

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?

With no output schema, the description steps in to describe the return value (valid JSON plus review warnings) and its limitation. Auth, determinism, side-effect profile, and retry semantics are all covered for a 2-parameter tool.

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 50%: attemptId is documented in the schema, but the nested input.text field has no description. The description compensates by clarifying that the payload is malformed JSON text and by adding non-obvious semantics for attemptId (fresh ID per intended call, never auto-retry an uncertain result).

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 (Repair) and resource (malformed JSON from LLM outputs) and enumerates the concrete failure classes it handles (missing quotes, trailing commas, code fences). This is clearly distinct from sibling converters/validators like invokeport_json_csv or invokeport_json_schema.

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 gives clear context for when it applies (LLM-generated malformed JSON) and a scoping caveat (syntax repair does not recover missing facts). It does not, however, name an alternative sibling such as invokeport_json_schema for validation or state explicit exclusions, so it stops short of a 5.

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.

Resources