Skip to main content
Glama

format_json

Reformat and pretty-print raw JSON text using a specified indentation level to improve readability and structure.

Instructions

Pretty-print (reformat) a JSON string with the given indentation.

Args: json_text: Raw JSON text to parse and reformat. indent: Number of spaces per indent level (0-8).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indentNo
json_textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations and no output schema, the description carries the disclosure burden. It conveys that this is a pure transformation, but says nothing about failure behavior on malformed input, whether the result is returned as a string, or handling of large inputs. Adequate but with clear gaps.

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-loaded one-line purpose followed by a tight two-entry Args list; nothing is wasted. The Args block is slightly redundant with the single-sentence summary but stays efficient.

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?

A simple two-parameter pure function with no side effects; both parameters are explained and the return value (reformatted JSON text) is self-evident even without an output schema. Only the invalid-input behavior is left unspecified.

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 description coverage is 0%, so the description must compensate, and it largely does: json_text is defined as raw JSON to parse and reformat, and indent is defined as spaces per level with a 0-8 range that the schema itself does not encode. No default value (2) is mentioned, which is the residual gap.

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 pair (pretty-print/reformat) and resource (a JSON string), plus the indentation behavior. It is clearly distinct from sibling validate_json, though the description never names or contrasts with that sibling explicitly.

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

Usage Guidelines2/5

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

No guidance on when to use this versus validate_json or json-related siblings, and no preconditions (e.g. input must already be valid JSON). Usage is only implied by the verb.

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