Skip to main content
Glama

util_json_flatten

Read-only

JSON flatten / unflatten — Flatten nested JSON to path keys (a.b.0.c) or unflatten path keys back to nested JSON. An array of objects becomes flat rows with a union of columns plus CSV - handy for spreadsheets and databases. Optional: mode=unflatten, sep (default .), arrays=bracket for a.c[0] style keys. Max 200,000 chars. Price: $0.001 USDC (Base, via x402).

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": "util_json_flatten"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsonYese.g. {"user":{"name":"Ada","tags":["x","y"]},"id":7}

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, destructiveHint=false, openWorldHint=true), so the bar is lower, and the description still adds two things annotations cannot express: a hard 200,000-character input ceiling and a $0.001 USDC charge via x402 on Base. Those are exactly the cost and size-limit facts an agent needs before calling. It stops short of saying how output is shaped for scalar or mixed input, but nothing contradicts the annotations.

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?

The core behavior is front-loaded in the first clause, and the remaining detail (array-of-object handling, optional flags, size cap, price) is packed into tight sentences with no filler. The punctuation is dense, with dash-joined clauses and an odd 'plus CSV - handy for' construction, but nothing is redundant.

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 single-parameter, no-output-schema utility with annotations already declaring it a safe read, the definition covers behavior, limits, cost, and the reverse mode. It does not need to explain return values, and the only real omission is a clarification of what gets produced for non-object input. The phantom mode/sep/arrays options are a correctness issue rather than a completeness one.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has a single required parameter 'json' documented at 100% coverage with a worked example, which alone would justify a baseline 3. The description instead advertises mode, sep, and arrays=bracket as if they were callable options, yet none of them exist in the input schema, so an agent following the text would attempt invalid arguments. That mismatch actively misleads rather than adding meaning beyond the schema.

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?

The description names a specific verb pair and resource: flatten nested JSON to path keys (a.b.0.c) or unflatten back to nested JSON, and it even specifies the array-of-objects case that expands to flat rows with a union of columns. That is far more concrete than a restatement of the name. The one gap is that util_json_to_csv and util_json_canonical sit right beside it and the CSV-output overlap is never disambiguated.

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?

'Handy for spreadsheets and databases' implies the intended contexts, and 'Optional: mode=unflatten' tells the agent how to reach the inverse operation. There is no explicit when-to-use versus when-not-to-use, and no routing to util_json_to_csv or util_json_canonical for adjacent jobs, so guidance is implied rather than stated.

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