Query internal metrics (read-only SQL)
metrics_queryRun read-only SQLite SELECT queries over analytics tables (metrics_daily, deployments, incidents, tickets) with capped results for reporting and incident analysis.
Instructions
Run one read-only SQLite SELECT over the analytics tables: metrics_daily, deployments, incidents, tickets. Writes, PRAGMA, ATTACH, recursive CTEs and system tables are rejected. Results are capped (default 100 rows). Read the schema://metrics resource for columns. Requires role: agent.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sql": "<sql>"
},
"name": "metrics_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One SELECT (or WITH ... SELECT) statement in SQLite syntax | |
| max_rows | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| columns | Yes | ||
| row_count | Yes | ||
| truncated | Yes |