query_data
Execute DuckDB SQL queries on CSV, Parquet, and JSON files to aggregate, join, and analyze data for targeted insights.
Instructions
Execute a DuckDB SQL query on data files (CSV, Parquet, JSON) to gain deeper insights.
CRITICAL: This is your PRIMARY tool for advanced data exploration.
- Use this to aggregate data (GROUP BY), join multiple files, calculate derived metrics, or inspect specific subsets.
- Prefer this over 'inspect_data' when you need to answer specific questions about the data distribution or relationships.
- You can query files directly in the FROM clause, e.g., "SELECT category, AVG(price) FROM 'data.csv' GROUP BY category".
- NOTE: Please use absolute paths for files in your FROM clause to avoid path resolution errors.
Args:
query: Standard DuckDB SQL query.
Returns:
JSON string containing the query results (limit 100 rows).
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": "query_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |