csv_query
Fetch a CSV from a URL or raw text, then query by selecting columns, filtering rows, sorting, and limiting results. Returns JSON or CSV.
Instructions
Fetch a CSV from a URL (or accept raw CSV text) and query it: select columns, filter rows, sort, and limit results. Returns JSON array of objects by default, or CSV with format=csv. Use instead of loading the full CSV into your context — send only the data you need.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL of the CSV file to fetch (http/https). | |
| csv | No | Raw CSV text (alternative to url). | |
| select | No | Comma-separated column names to include (e.g. 'name,age,country'). Omit to include all columns. | |
| filter | No | Row filter expression: 'column op value'. Operators: = != > >= < <= contains startswith endswith. E.g. 'age > 30' or 'country = US'. | |
| sort_by | No | Column name to sort by. | |
| sort_dir | No | Sort direction: 'asc' (default) or 'desc'. | |
| limit | No | Maximum number of rows to return (default 500, max 5000). | |
| format | No | Output format: 'json' (default) or 'csv'. |