data_query
Query JSON, YAML, or TOML files with yq expressions to extract specific data, filter content, or transform structure without modifying the file.
Instructions
Extract specific data, filter content, or transform structure without modification.
Use when you need to extract specific data, filter content, or transform the structure of a JSON, YAML, or TOML file without modifying it.
Output contract: Returns {"success": bool, "result": Any, "format": str, "file": str, ...}. Side effects: None (read-only). Failure modes: FileNotFoundError if file missing. ToolError if format disabled or query fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | Pagination cursor from previous response (omit for first page) | |
| file_path | Yes | Path to file | |
| expression | Yes | yq expression to evaluate (e.g., '.name', '.items[]', '.data.users') | |
| output_format | No | Output format (defaults to same as input file format) | |
| document_index | No | Optional YAML document index for multi-document files (0-based) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| format | No | ||
| result | No | ||
| success | Yes | ||
| advisory | No | ||
| paginated | No | ||
| nextCursor | No | ||
| schema_info | No | ||
| structure_summary | No |