Skip to main content
Glama
influxdata

InfluxDB MCP Server

Official
by influxdata

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

TableJSON Schema
NameRequiredDescriptionDefault
qYesRead-only SQL query to run
dbYesDatabase name to query
formatNoOutput format for query resultsjson
paramsNoOptional query parameters to pass through
maxRowsNoMaximum rows to return. Default 1000; hard max 5000.
timeoutMsNoOptional query timeout in milliseconds
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses the tool is read-only, bounded, defaults to JSON, and returns structured rows/warnings/metadata. It also reveals a subtle behavior: quoted identifiers are exact, but if the quoted selector contains '*', it's treated as wildcard intent requiring describe_table expansion. This is valuable added context beyond the schema. It doesn't mention permissions or error handling, but the disclosed traits are significant.

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?

The description is somewhat long but well-structured: a clear first sentence for purpose, a second for output behavior, then a caveat and an alternative. Each sentence adds meaningful information, and the length is justified by the tricky wildcard behavior and sibling guidance. It could be slightly more compact, but it's not wasteful.

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?

Given 6 parameters, no output schema, and no annotations, the description covers the essential aspects: purpose, output format, return contents, a non-obvious edge case, and an alternative tool. It doesn't explain what 'bounded' means in detail (schema covers maxRows/timeout), nor does it distinguish from sibling execute_query, but for a read-only SQL query tool, it is reasonably complete.

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

Parameters3/5

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

The schema provides descriptions for all 6 parameters (100% coverage), so the bar for added value is low. The description adds minimal param-specific meaning; it implies boundedness relates to maxRows/timeout and mentions format default, but doesn't explain any parameter syntax or semantics beyond what the schema already states. Baseline 3 is appropriate.

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?

The description clearly states the tool runs 'one bounded, read-only SQL query against an InfluxDB 3 database.' It specifies the verb (run), resource (SQL query), and scope (bounded, read-only), and distinguishes from sibling query_influxql by explicitly mentioning SQL. The mention of default JSON output and return of structured rows/warnings/metadata further clarifies its function.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'Use query_influxql regex only when the user explicitly asks for InfluxQL or regex field selection.' It also offers a clear conditional workflow for quoted wildcard selectors (call describe_table, expand, retry one bounded query_sql), which helps the agent decide when to take extra steps. This is strong alternative/context guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/influxdata/influxdb3_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server