Skip to main content
Glama

Razi Dev Utilities

format_json

Validate and re-print a JSON string. Returns JSON { valid, formatted, minified } — the indented form and the whitespace-free form as plain strings, with no syntax highlighting or colour. Invalid JSON is rejected with the parser's own error message rather than returned as valid:false, so a successful call is proof the input parses. Round-tripping through the parser normalises the document: key order is kept but comments, trailing commas and duplicate keys are lost, and large integers lose precision.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonYesThe JSON document as a string. Must be strict JSON — comments and trailing commas are parse errors.
indentNoSpaces per indent level in `formatted`, 0 to 10. Default 2; a value outside that range or a non-number silently falls back to 2. Use 0 for newlines with no indentation, or read `minified` for no whitespace at all.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly. It discloses the exact return shape, that invalid JSON is rejected with a parser error rather than returning valid:false, and that round-tripping normalizes the document (losing comments, trailing commas, duplicate keys, and precision on large integers). This is exceptional behavioral transparency.

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 front-loaded with the purpose, then efficiently covers output format, error handling, and normalization in three concise sentences. Every clause adds value; there is no redundancy or fluff.

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 simple two-parameter tool with no output schema, the description fully explains the return object, error behavior, and side effects (normalization). Nothing an agent needs to correctly call and interpret the tool 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% for both parameters, so the schema already documents their meaning. The description adds no new parameter-specific detail; it focuses on output and behavior. Baseline of 3 is appropriate when schema covers everything.

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 ('Validate and re-print') and resource ('a JSON string'), and specifies the output structure. It clearly distinguishes itself from the sibling tools (calculate_percentage, decode_base64, etc.) by focusing on JSON formatting and validation.

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 clearly implies the tool is for validating and formatting JSON strings, and the mention of normalization and error behavior sets expectations. However, it doesn't explicitly name alternative tools or state when not to use it; given the siblings are unrelated, this is a minor gap.

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