execute_query
Runs SQL queries against an InfluxDB database and returns results in JSON, CSV, Parquet, JSONL, or pretty format; kept for compatibility with existing clients.
Instructions
Deprecated since 2.0.0. Use query_sql for SQL queries. execute_query remains available for compatibility with existing clients.
Execute a SQL query against an InfluxDB database (all versions). Returns results in the specified format (defaults to JSON). On Cloud Dedicated, Cloud Serverless, and Clustered, this tool supports only JSON output. For bounded reads that report completeness, use query_sql.
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/Clustered & Cloud Serverless (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)
Note: Both products require CAST for all aggregation functions (COUNT, SUM, AVG, MIN, MAX) to ensure results appear properly in response
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | SQL query to execute. | |
| format | No | Output format for query results. On Cloud Dedicated, Cloud Serverless, and Clustered, this tool supports only JSON. | json |
| database | Yes | Name of the database/bucket to query |