Skip to main content
Glama

JSON Format

json_format
Read-only

Validate and reformat a JSON string. Pretty-prints with a chosen indent (default) or minifies to a single line. Invalid JSON returns a parse error naming the position.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "json": "<json>"
    },
    "name": "json_format"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsonYesThe JSON text to validate and reformat.
modeNoPretty-print with indentation, or minify to one line. Defaults to pretty.pretty
indentNoSpaces of indentation when pretty-printing. Ignored when minifying.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, non-destructive, closed-world), so the bar is lower. The description still adds useful behavior: the failure path returns a parse error naming the offending position, and mode/indent defaults are stated up front.

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?

Three short sentences: capability, output modes, error behavior. Front-loaded with the primary action and no redundant or filler wording.

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?

For a three-parameter utility with no output schema, the definition covers input expectations, both output shapes, and the error path. Nothing an agent needs in order to call it correctly is missing.

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 all three parameters are already documented, including the 'Ignored when minifying' note on indent. The description echoes those defaults and the cross-parameter interaction but adds no new syntax or format detail beyond the schema.

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 and resource ('Validate and reformat a JSON string') and enumerates both outcomes (pretty-print with indent, minify to one line). No sibling in the catalog touches JSON formatting, so the agent can identify this tool immediately.

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

Usage Guidelines3/5

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

Usage is implied by the mode descriptions ('Pretty-prints with a chosen indent (default) or minifies'), but there is no explicit guidance on when to prefer minify over pretty, nor any statement about when this tool should not be used (e.g., non-JSON structured data). With no overlapping sibling, the gap is mild but real.

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