Skip to main content
Glama

Query JSON

json_query
Read-onlyIdempotent

Query a JSON document using a dot or bracket path to extract specific values, with optional pretty-printed output for easier reading.

Instructions

Query a JSON document with a dot/bracket path and optionally return pretty output.

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

Input Schema

NameRequiredDescriptionDefault
jsonYesJSON string to query
queryNoDot-notation path query (e.g., 'users.0.name')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and non-open-world, so the safety profile is fully covered. The description adds little new behavior, and its mention of 'pretty output' is unsupported by any corresponding parameter, slightly muddying rather than clarifying behavior.

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 front-loaded sentence with no filler, and the query mechanism is stated immediately. The trailing 'optionally return pretty output' is the one clause that doesn't earn its place, since no such option exists in the schema.

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?

This is a simple two-parameter read tool with rich annotations and no output schema, so the description need not document return values. Still, it omits useful behavior an agent would want — what happens when the path matches nothing, and how bracket/array indices are handled in edge cases.

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 coverage is 100%, so both parameters are already documented, and the baseline is 3. The description does add one piece of meaning — bracket notation in addition to dots — which goes slightly beyond the schema's dot-only example, but the unexplained 'pretty output' option offsets that gain.

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 states a specific verb ('Query') and resource ('a JSON document') plus the mechanism (dot/bracket path), which separates it from SQL-oriented siblings like query_database or describe_table. It doesn't explicitly name an alternative, but the resource is distinctive enough to identify the tool.

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 only implied by 'Query a JSON document' — an agent can infer this is for JSON blobs rather than relational data, but there is no explicit when-to-use/when-not guidance or pointer to a sibling such as query_database for structured stores.

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