Skip to main content
Glama

json_format

Format JSON with indentation (2 or 4 spaces, or tabs) and optionally sorted keys. Returns the formatted text. Use to make machine JSON readable or to normalise it for diffs. Costs $0.001 in USDC on Base per successful call, paid with x402.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe JSON text
indentNo2 (default), 4 or tab
sortKeysNotrue to sort object keys

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only cover safety/openness hints; the description adds genuinely new behavioral facts an agent needs: the call costs $0.001 USDC on Base, is paid via x402, and is charged per successful call (implying failures aren't billed). It also states the return is the formatted text. It does not say what happens on malformed JSON input, which would be the remaining useful disclosure.

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 short sentences, each earning its place: purpose, return value, use case, and cost. The core purpose is front-loaded and nothing is repeated.

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?

With no output schema, the description correctly says it returns the formatted text, and it discloses the payment model for this paid endpoint. The only material gap is error behavior on invalid JSON, which matters given that json_repair and json_validate exist as alternatives.

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 description coverage is 100%, so the schema already documents text, indent and sortKeys. The description restates the indent options and sorted-keys flag but adds no syntax detail beyond the schema (e.g. how sortKeys is passed, whether 'tab' is the literal value). Baseline 3 applies when the schema carries the parameter burden.

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+resource (format JSON) plus the concrete operations it performs: indentation with 2/4 spaces or tabs and optional key sorting. This clearly separates it from siblings like json_minify, json_repair and json_validate without needing to open their schemas.

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?

Gives explicit use context: 'Use to make machine JSON readable or to normalise it for diffs.' That is a clear when-to-use statement, but it offers no exclusions and never routes the agent among the closely related json_minify / json_repair / json_validate siblings.

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