JSON query (JSONPath)
json_queryExtract 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/
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": {
"query": "<query>"
},
"name": "json_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Or: a path to a JSON file (UTF-8; use this for big inputs). | |
| text | No | The JSON as inline text. | |
| limit | No | Return at most this many matches (default 1000). | |
| query | Yes | JSONPath expression, e.g. "$.store.book[*].author" or "$..book[?(@.price < 10)].title". | |
| output | No | Optional: write the matched values as a JSON array to this file. |