Skip to main content
Glama

json_flatten

Flatten a deeply nested JSON object into dotted keys, or unflatten dotted keys back into a tree. Pure CPU, instant.

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_flatten"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsonYesJSON object to flatten
delimiterNoKey delimiter (default dot)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed3 schema fields changed
    • addedInput schema / properties / delimiter
      Added value: +{
      +  "description": "Key delimiter (default dot)",
      +  "type": "string"
      +}
    • addedInput schema / properties / json
      Added value: +{
      +  "description": "JSON object to flatten",
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "json"
      +]
  4. Added

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description does real work by declaring 'Pure CPU, instant', which tells the agent this is a local, non-network, low-latency operation with no side effects on external state. However, the core behavioral ambiguity -- which mode runs and what triggers each -- is left undisclosed, and there is no statement about behavior on non-object input or invalid dotted keys.

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?

A single tight sentence with the primary operation front-loaded and the inverse mode appended; every clause carries information and there is no filler.

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 utility with fully described schema and no output schema, the description is nearly sufficient. The notable gap is that it claims bidirectional capability while the schema exposes no way to choose a direction, leaving an agent unsure of how to request unflattening.

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 both 'json' and 'delimiter' are already documented, including the dot default. The description's mention of 'dotted keys' reinforces the delimiter semantics but adds no syntax, format, or edge-case meaning beyond the schema, so the baseline 3 applies.

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 and resource ('Flatten a deeply nested JSON object into dotted keys') and names a second mode ('unflatten dotted keys back into a tree'). It is clear what the tool does, but it does not distinguish itself from near siblings such as json_path, json_merge, or json_validate.

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?

The description presents two opposite operations (flatten and unflatten) but never says how an agent selects between them -- there is no direction parameter in the schema -- and gives no when-to-use guidance versus json_merge, json_path, or json_validate. The dual mode is advertised without any invocation guidance.

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