Skip to main content
Glama

Agent Data Tools: Utilities

Pretty-print JSON

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. Example: text={"b":2,"a":1}, indent=2, sortKeys=true. Price $0.003/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only; not marked read-only because each call is charged.

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.1/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses pricing ($0.003/call), the free tier (first 25 free, failed calls free), auth options, and explicitly reconciles its read-only nature with the readOnlyHint=false annotation ('Reads or computes only; not marked read-only because each call is charged'). This is exactly the kind of context annotations cannot carry.

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

Conciseness4/5

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

Front-loads purpose, then usage, then example, then commercial terms. Every sentence serves a purpose. The pricing sentence is dense but necessary for a metered tool; nothing is wasted.

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, it still states the return value ('Returns the formatted text') and covers billing, auth, and the read-only caveat. An agent has everything needed to call it correctly.

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 the schema already documents all three parameters. The worked example (text={...}, indent=2, sortKeys=true) reinforces usage but adds little semantic detail beyond the schema's own descriptions.

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?

States a specific verb (format/pretty-print) and resource (JSON), and the optional sorted-keys behavior scopes it further. It is distinguishable from json_minify and json_validate by intent ('make machine JSON readable'), though it never names those siblings explicitly.

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 clear usage context: 'make machine JSON readable or to normalise it for diffs.' This tells the agent when the tool is appropriate but names no alternatives and states no exclusions (e.g., use json_repair when the input is malformed).

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.