---
title: "query_metrics"
description: "Execute an InfluxQL query against the operator's metrics database."
sidebarTitle: "query_metrics"
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

{/* GENERATED FILE: do not edit by hand. Regenerate with: node scripts/generate.mjs */}

Execute an InfluxQL query against the operator's metrics database.

<Note>
  **Read-only · Calls external systems.** Safe to call: this tool does not modify data.
</Note>

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `detail` | boolean | No | Return full JSON instead of statistical summary (default: false) |
| `operator` | string | Yes | Operator slug (= InfluxDB database name) |
| `precision` | string | No | Query time precision (s, ms, u, ns) |
| `query` | string | Yes | InfluxQL query string |
| `summary_mode` | string | No | Output detail: 'full' (default, all metrics), 'executive' (1-line status, key metrics only) |

## Example arguments

Illustrative arguments an agent supplies when calling this tool:

```json
{
  "operator": "string",
  "query": "string"
}
```

## Description

```text
Returns statistical summaries by default; use detail=true for raw JSON.

PREREQUISITE: call platform_guide topic=metrics for the schema discovery workflow, measurement catalog, and example queries.

Start with SHOW MEASUREMENTS to discover tables, then SHOW FIELD KEYS FROM <measurement> for fields. Always include a WHERE time clause (recommended max 90 days for summary mode, 30 days for detail=true). In detail mode, results truncated at 5000 points.
```

## Related

- [`platform_guide`](/mcp/tools/discovery/platform_guide)

## What's next?

<Columns cols={2}>
  <Card title="All MCP tools" icon="robot" href="/mcp/tools/overview">
    Browse the full tool reference by category.
  </Card>
  <Card title="Connect a client" icon="plug" href="/mcp/connect">
    Point Claude, Cursor, or Claude Code at the server.
  </Card>
</Columns>
