query_sql
Run a bounded, read-only SQL query against an InfluxDB 3 database to retrieve structured rows, warnings, and metadata.
Instructions
Run one bounded, read-only SQL query against an InfluxDB 3 database. Defaults to JSON output and returns structured rows, warnings, and query metadata. In SQL, quoted identifiers are exact column names; if a quoted selector contains *, treat it as wildcard intent, call describe_table, expand matching fields explicitly, then retry one bounded query_sql. Use query_influxql regex only when the user explicitly asks for InfluxQL or regex field selection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Read-only SQL query to run | |
| db | Yes | Database name to query | |
| format | No | Output format for query results | json |
| params | No | Optional query parameters to pass through | |
| maxRows | No | Maximum rows to return. Default 1000; hard max 5000. | |
| timeoutMs | No | Optional query timeout in milliseconds |