execute_query
Execute SQL queries against InfluxDB databases and return results in JSON, CSV, Parquet, JSONL, or pretty format; check large time-series datasets with COUNT(*) and LIMIT/OFFSET first.
Instructions
Execute a SQL query against an InfluxDB database (all versions). Returns results in the specified format (defaults to JSON).
Large Dataset Warning: InfluxDB might contain massive time-series data. Always use COUNT(*) first to check size, then LIMIT/OFFSET for large results (>1000 rows).
Cloud Dedicated (v3) Requirements:
GROUP BY: Include all group columns in SELECT (e.g., SELECT place, COUNT(*) ... GROUP BY place)
Aggregations: Cast and alias COUNT (e.g., CAST(COUNT(*) AS DOUBLE) AS count)
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": {
"database": "<database>",
"query": "<query>"
},
"name": "execute_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | SQL query to execute. | |
| format | No | Output format for query results | json |
| database | Yes | Name of the database to query |