Skip to main content
Glama

JSON formatter

json_format
Read-only

Validate JSON and re-print it with an indent of 2 or 4 spaces, or minified with indent 0. Use to check whether a string is valid JSON or to make it readable. Runs locally. Returns the formatted JSON, or the parser's error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe JSON text.
indentNoSpaces per level: 0 (minify), 2 or 4. Default 2.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed2 schema fields changed
    • changedInput schema / properties / indent / description
      Previous value: -"Indent width; default 2"New value: +"Indentation width in spaces. Accepts 2 or 4; defaults to 2 if omitted."
    • changedInput schema / properties / input / description
      Previous value: -"Raw JSON text"New value: +"Raw JSON text to validate and format. May be minified or already pretty-printed."
  4. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the readOnlyHint annotation (which already marks it as a safe read), the description adds 'Runs locally' (execution environment) and 'Returns the formatted JSON, or the parser's error message' (output behavior on failure). These are useful behavioral details not captured in annotations, though it could mention potential size limits or encoding assumptions.

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?

The description is exactly two sentences, front-loading the core purpose and options in the first sentence, then adding usage context and a note about local execution. There is zero fluff; every word contributes to understanding the tool's function and behavior.

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?

For a simple tool with two parameters and no output schema, the description covers validation, formatting options, indent defaults, execution locality, and the return value on success and failure. It does not mention edge cases like empty strings or very large inputs, but these are not critical for a formatter and are reasonably implied. The description is complete enough for an agent to call the tool 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?

The input schema already fully documents both parameters: 'text' is described as 'The JSON text.' and 'indent' has a detailed description covering 0 (minify), 2, 4, and default 2. The description only restates the indent purpose ('indent of 2 or 4 spaces, or minified with indent 0') without adding new meaning beyond the schema. Per the rubric, baseline 3 applies when schema coverage is 100%.

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?

The description uses specific verbs ('Validate' and 're-print') with a clear resource (JSON) and explicitly lists indent options (2, 4, or minified 0). This is distinct from all sibling tools (encoding, DNS, JWT, etc.), so an agent can immediately identify what this tool does and that it is unique among its siblings.

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?

The description states 'Use to check whether a string is valid JSON or to make it readable,' providing clear use cases. It also notes 'Runs locally,' which helps an agent decide when to invoke it (e.g., offline or when network tools are not needed). It doesn't explicitly name alternatives, but given the sibling set is unrelated, the guidance is sufficient.

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