Skip to main content
Glama

repairAndSanitizeJson

Read-only

Deterministically repairs malformed or truncated LLM JSON payloads (missing quotes, trailing commas, markdown fences) while scrubbing embedded prompt-injection payloads. Price: 0.010 USDC on Base or Solana.

Input Schema

NameRequiredDescriptionDefault
raw_jsonYes

Output Schema

NameRequiredDescriptionDefault
repairedYes
valid_jsonYes
injection_detectedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "injection_detected": {
      +      "type": "boolean"
      +    },
      +    "repaired": {
      +      "type": "boolean"
      +    },
      +    "valid_json": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "repaired",
      +    "valid_json",
      +    "injection_detected"
      +  ],
      +  "type": "object"
      +}
  2. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, non-destructive) and open-world scope; the description adds real value on top by disclosing that repair is deterministic, enumerating the failure classes it handles, noting the injection-scrubbing behavior, and stating the cost (0.010 USDC on Base or Solana). It does not say what happens when the payload is unrepairable or how payment is settled, which keeps it short of a 5.

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?

Two front-loaded sentences: capability and grammar first, commercial term last. Every clause carries information, and the list of defects is packed parenthetically rather than sprawling.

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?

Return values are covered by the output schema and safety by the annotations, and the single-parameter surface is fully described. The remaining unstated piece is failure behavior on irreparable input and the mechanics of the paid call, which matters given this is a paid, open-world 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?

The single parameter has 0% schema description coverage, so the description must carry the meaning. By naming the failure classes and markdown fences, it makes clear that raw_json is the arbitrary malformed text blob to be repaired rather than strict JSON, which meaningfully compensates for the empty schema.

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 gives a specific verb and resource: it repairs malformed or truncated LLM JSON payloads and scrubs prompt-injection content. That is concrete enough for an agent to identify the operation, but it never distinguishes itself from the overlapping sibling canary_sanitize, which also suggests scrubbing/sanitizing behavior.

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 input domain (LLM JSON output with missing quotes, trailing commas, markdown fences) implies when to reach for this tool, but there is no explicit when-to-use/when-not statement and no routing to or away from canary_sanitize. The pricing sentence is the only additional selection signal.

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.