Skip to main content
Glama

format_json

Read-onlyIdempotent

Json formatter — validate, pretty-print or minify

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": {
      "text": "<text>"
    },
    "name": "format_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text to process, plain UTF-8, for example: The quick brown fox.
indentNoSpaces per indent level, 0 to 8; default 2.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / indent / description
      Added value: +"Spaces per indent level, 0 to 8; default 2."
    • addedInput schema / properties / text / description
      Added value: +"The text to process, plain UTF-8, for example: The quick brown fox."
  2. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so safety is covered. The description adds no detail beyond that — notably it doesn't explain failure behavior for malformed JSON, which matters for a 'validate' claim, nor the output form (string vs structure).

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?

A single compact line, front-loaded with the resource and the three operations. No waste, though the dash-separated list is terse enough to obscure which operation is default.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter read-only tool with no output schema, the definition is minimally adequate. It omits the default operation and error semantics, which an agent needs when validation fails.

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 is 3; the description contributes the behavioral framing of indent='minify' as an alternative to numeric indentation, tying the enum to the minify operation. Still no mention of default behavior when indent is omitted beyond the schema's own note.

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 set (validate, pretty-print, minify) on a specific resource (JSON). Clear enough to distinguish from unrelated siblings like json_to_pptx, though it doesn't explicitly contrast with text_paper_format.

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?

Implied usage from the three named operations, but no statement of when to choose pretty-print vs minify vs validate, and no guidance on what happens if the input is invalid JSON.

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