Skip to main content
Glama

json_format

Parse and reformat JSON strings. Choose indent level to pretty-print, validate, or minify JSON.

Instructions

Parse and reformat a JSON string with a configurable indent level (0 = minified, 2 = standard pretty-print). Returns the reformatted JSON string, or an error if the input is not valid JSON. Has no side effects. Use to pretty-print, validate, or minify JSON. Do NOT use to query or transform JSON values — use json_query instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonYesThe JSON string to parse and reformat.
indentNoIndentation spaces (0–8). 0 = minified. Default 2.
Behavior5/5

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

No annotations provided, so description fully covers behavior: declares no side effects, describes return value (reformatted JSON or error), and implies idempotence.

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 short sentences with no wasted words. Front-loaded with core purpose, then usage guidance.

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?

Given no output schema, description clearly states return value and error behavior. Covers all use cases (validate, pretty-print, minify) without gaps.

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 100% so baseline 3. Description adds extra meaning for indent parameter ('0 = minified, 2 = standard pretty-print'), which helps agent choose values.

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?

Specifies action (parse and reformat), object (JSON string), and result (reformatted JSON). Distinguishes from sibling json_query by stating it is for pretty-print/validate/minify, not for querying.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use (pretty-print, validate, minify) and when not to use (query or transform), with direct reference to alternative json_query.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/icosaedro-git/toolsnap-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server