Skip to main content
Glama

JSON query (JSONPath)

json_query
Read-onlyIdempotent

Extract values from JSON using JSONPath expressions, returning each match with its exact path. Supports filters, slices, unions, and recursive lookups on inline text or files.

Instructions

Pick values out of JSON with a JSONPath expression. Supported: $ (root, optional), .key, ['key'], [0], [-1], [], ., ..key (recursive), [start:end:step] slices, unions [0,2] / ['a','b'], and filters like [?(@.price < 10 && @.tags)] (==, !=, <, <=, >, >=, =~ /regex/i, &&, ||, !, .length). Returns each match with its path (the same path style the website's tree view copies, e.g. $.store.book[0].title). Give "text" or a file "path". Web version: https://s3eidat.github.io/json-studio/

Input Schema

NameRequiredDescriptionDefault
pathNoOr: a path to a JSON file (UTF-8; use this for big inputs).
textNoThe JSON as inline text.
limitNoReturn at most this many matches (default 1000).
queryYesJSONPath expression, e.g. "$.store.book[*].author" or "$..book[?(@.price < 10)].title".
outputNoOptional: write the matched values as a JSON array to this file.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false. The description adds real value beyond that: it discloses the return format (each match with its path, matching the website tree style), the output-path write option, and regex/flag support – context an agent needs to interpret results.

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?

Purpose is front-loaded in the first sentence, followed by a compact but dense syntax reference. The embedded URL is a minor distraction, but the content is largely earned.

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?

No output schema exists, yet the description explains the return shape (values with paths) and the optional file-write behavior, covering what an agent needs. The website URL and minor edge cases (e.g., malformed query errors) are the only small gaps.

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 coverage is 100%, so the baseline is 3, but the description goes further by elaborating JSONPath syntax (slices, unions, filters, operators, .length) that the schema only hints at with examples. It meaningfully reduces query-authoring ambiguity.

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 ('pick values out of') and resource ('JSON with a JSONPath expression'), immediately distinguishing it from siblings like json_format or xml_query. An agent can identify its role without opening the schema.

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?

It notes you may give inline "text" or a file "path" (with a nudge toward path for big inputs), which is useful usage context. However, it never states when to choose this over sibling query/format tools or any exclusions, so routing guidance is only implied.

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

Deploy Server

Other Tools