Query JSON File
jq_queryQuery a saved JSON file using jq-like filters to extract specific data without making a new HTTP request.
Instructions
Query an existing JSON file with a jq-like filter expression.
This tool allows you to extract data from saved JSON files without making new HTTP requests. Useful for:
Extracting different fields from a large saved response
Applying multiple queries to the same data
Processing any local JSON file within allowed directories
Args:
filepath (string, required): Path to a JSON file to query
jq_filter (string, required): JSON path filter expression
max_result_size (number): Max bytes inline (default: 500KB, max: 1MB)
save_to_file (boolean): Force save result to file
output_dir (string): Custom directory to save result files
Filter Syntax:
.key - Get object property
.[n] - Get array element at index n (non-negative only, also .n with dot notation)
.[n:m] - Array slice from n to m
.["key"] - Bracket notation for keys with special chars
.name,.email - Multiple comma-separated paths (returns array of values, max 20)
Note: Negative indices not supported (unlike real jq)
Security:
Only files in these directories can be read:
Our temp directory (files saved by curl_execute)
MCP_CURL_OUTPUT_DIR environment variable path
Current working directory and ALL subdirectories (broad - ensure cwd is safe)
Maximum file size: 10MB
Examples:
Extract name: { "filepath": "/path/to/response.txt", "jq_filter": ".name" }
Multiple fields: { "filepath": "/path/to/data.json", "jq_filter": ".name,.email,.id" }
Array slice: { "filepath": "/path/to/list.json", "jq_filter": ".items[0:5]" }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filepath | Yes | Path to a JSON file to query. Must be in temp directory, MCP_CURL_OUTPUT_DIR, or current working directory. | |
| jq_filter | Yes | JSON path filter expression. Supports: .key, .[n] or .n (non-negative array index), .[n:m] (slice), .["key"] (bracket notation), .a,.b (multiple comma-separated paths return array, max 20). Negative indices not supported. | |
| max_result_size | No | Max bytes to return inline (default: 500KB, max: 1MB). Larger results auto-save to file | |
| save_to_file | No | Force save result to file. Returns filepath instead of content | |
| output_dir | No | Directory to save result files (must exist and be writable) |