Skip to main content
Glama

Query internal metrics (read-only SQL)

metrics_query
Read-onlyIdempotent

Run 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

NameRequiredDescriptionDefault
sqlYesOne SELECT (or WITH ... SELECT) statement in SQLite syntax
max_rowsNo

Output Schema

NameRequiredDescriptionDefault
rowsYes
columnsYes
row_countYes
truncatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint=false, openWorldHint=false), and the description adds real value on top: the explicit rejection list (writes, PRAGMA, ATTACH, recursive CTEs, system tables), the 100-row default cap, and the required 'role: agent'. With annotations doing part of the work, a 4 rather than a 5 is appropriate.

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

Conciseness5/5

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

Four tight sentences, front-loaded with what the tool does, followed by restrictions, limits, and prerequisites. No filler and every clause carries operational information an agent needs before calling.

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?

An output schema exists, so return-value documentation is unnecessary, and the description covers tables, restrictions, row limits, and auth role. The only modest gap is that it does not explain how the cap interacts with the max_rows maximum of 500, but overall it is complete for a read-only query tool.

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 50%: sql is documented in the schema, but max_rows carries only default/min/max constraints with no prose. The description compensates by stating that results are capped with a default of 100 rows and by specifying that exactly one SELECT (or WITH ... SELECT) is expected, adding meaning beyond the raw schema for both parameters.

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 states a concrete verb and resource ('Run one read-only SQLite SELECT over the analytics tables') and enumerates the four queryable tables, which is far more specific than the title alone. An agent can immediately tell this apart from row-oriented siblings like tickets_list or ticket_get.

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

Usage Guidelines3/5

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

It gives useful constraints on what form of query is allowed and points to schema://metrics for column discovery, but never states when to prefer this tool over a structured sibling such as tickets_list or expense_lookup. Usage is implied rather than routed.

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