Skip to main content
Glama
influxdata

InfluxDB MCP Server

Official
by influxdata

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

NameRequiredDescriptionDefault
queryYesSQL query to execute.
formatNoOutput format for query results. On Cloud Dedicated, Cloud Serverless, and Clustered, this tool supports only JSON.json
databaseYesName of the database/bucket to query

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.0.0
    • changedInput schema / properties / format / description
      Previous value: -"Output format for query results"New value: +"Output format for query results. On Cloud Dedicated, Cloud Serverless, and Clustered, this tool supports only JSON."
  2. First observedv1.4.1-test.1

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does substantial work: it discloses deprecation status, the default JSON output, that Cloud Dedicated/Serverless/Clustered support only JSON, and a large-dataset safety protocol (COUNT(*) first, then LIMIT/OFFSET). It stops short of describing error behavior, authentication requirements, or pagination/truncation semantics of the response, which keeps it below 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Deprecation and the sibling hand-off are correctly front-loaded, and the version-specific requirements are grouped under a heading. It loses a point for redundancy, since the advice to use query_sql appears in both the opening and the closing lines.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter tool with no output schema and no annotations, the description covers the important failure modes: version-gated format support, unsafe result sizes, and SQL dialect differences that would otherwise produce malformed queries. Return-value structure is only partly described, but the main operational risks are addressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning about the `query` parameter: version-specific SQL rules for GROUP BY column inclusion and CAST/alias requirements for aggregations, plus the row-volume strategy. That is query-construction semantics the schema does not provide.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Execute a SQL query against an InfluxDB database") and immediately scopes it against the sibling query_sql and, implicitly, query_influxql. An agent can distinguish this from the other query tools without reading the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says the tool is deprecated since 2.0.0 and that query_sql should be used for SQL, while giving a concrete reason to still call it (compatibility with existing clients) and a second routing condition ("For bounded reads that report completeness, use query_sql"). The guidance is clear, but the twice-repeated hand-off to query_sql without saying when execute_query is the correct choice beyond legacy compatibility leaves mild ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.