Skip to main content
Glama
GautamVhavle

Universal JSON Agent MCP

by GautamVhavle

flatten

Convert nested JSON objects into dot-notation key-value pairs, using optional path, separator, and depth limits to simplify querying and analysis.

Instructions

Flatten a nested JSON object into dot-notation key-value pairs.

Converts nested structures like {"a": {"b": 1}} into {"a.b": 1}. Walks as deep as Python allows unless max_depth is set.

Args: alias: The alias of the loaded document. path: Dot-notation path to the object to flatten. Empty means root. separator: The separator for flattened keys (default "."). max_depth: Stop after this many nested levels. Omit to walk the full safe depth.

Returns: A flat mapping of dotted-path keys to their values.

Input Schema

NameRequiredDescriptionDefault
pathNo
aliasYes
max_depthNo
separatorNo.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.2
    • addedInput schema / properties / max_depth
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Max Depth"
      +}
  2. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose the key trait that the walk is unbounded unless max_depth is given (and references a 'safe depth'), and it describes the return shape, but it says nothing about error behavior for a bad alias/path, whether the operation is read-only, or whether it mutates the source document.

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?

Front-loaded with a single-line purpose before the example and Args/Returns blocks, so an agent gets the gist immediately. The Returns section partly restates the output schema, adding a little redundancy, but the Args block earns its space given 0% schema coverage.

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 4-parameter transform tool with no annotations, the description covers purpose, each argument, and the return shape, which is enough to call it correctly. An output schema exists, so the Returns prose is mildly duplicative, and error/permission behavior remains the only real gap.

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 description coverage is 0%, so the description must compensate, and it largely does: each of the four parameters is explained with meaning beyond the schema titles — 'Empty means root' for path, the separator default, and max_depth's stopping semantics. It stops short of giving examples of separator alternatives or path syntax beyond 'dot-notation'.

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 nested JSON object into dot-notation key-value pairs') and reinforces it with a concrete before/after example. An agent can distinguish this from read-style siblings like get_structure or jsonpath_query, though the description never names those alternatives explicitly.

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 'Walks as deep as Python allows unless max_depth is set', which hints at the default recursion behavior. There is no explicit statement of when to choose this over jsonpath_query or get_structure, and no exclusions or prerequisites beyond the alias argument.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.