Skip to main content
Glama
Local Developer Toolbox MCP

Local Developer Toolbox MCP

Format JSON payload

format_json_payload
Read-only

Clean up and pretty-print JSON from Markdown code fences or surrounding prose, remove trailing commas, and report cleanup details while preserving values.

Instructions

Clean up and pretty-print a JSON object or array. Accepts a JSON code fence or surrounding prose and removes trailing commas, while preserving JSON values and reporting cleanup details.

Input Schema

NameRequiredDescriptionDefault
indentNoNumber of spaces for indentation; use 0 for compact JSON.
payloadYesJSON text, optionally inside a Markdown code fence or surrounded by prose.

Output Schema

NameRequiredDescriptionDefault
formattedJsonYes
removedTrailingCommasYes
extractedFromSurroundingTextYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish readOnlyHint and closed-world safety, so the description only needs to add behavior beyond that. It does: it discloses that trailing commas are removed, JSON values are preserved, and cleanup details are reported, which tells an agent the transformation is lossless-ish and observable. It stops short of saying what happens on unparseable JSON.

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 sentences, front-loaded with the core action, with the input-tolerance and cleanup behavior packed into the second. No filler, no repetition of the title.

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?

An output schema exists, so return values needn't be explained; the description still usefully notes that cleanup details are reported. Inputs, tolerance for fences/prose, and the mutation-free nature of the transform are all covered, leaving only error behavior unspecified.

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?

Schema coverage is 100%, so both 'payload' (fence/prose tolerance, 1MB cap) and 'indent' (0 for compact) are already fully documented in the schema. The description's note about accepting a code fence or prose restates the payload description rather than adding new semantics, so the baseline 3 applies.

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 and resource ('Clean up and pretty-print a JSON object or array') and immediately scopes it to JSON text with optional fences or prose. An agent can tell exactly what the tool consumes and produces without opening the schema.

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 description implies the use case (repairing/prettifying JSON that carries fences, prose, or trailing commas) but never states when to reach for this over, say, a validator or parser, nor any exclusions. Usage is inferable rather than explicit.

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