Skip to main content
Glama

query_metric

Run a governed metric by name with optional dimensions and filters; get rows, metric definition, and compiled SQL for audit, no SQL input.

Instructions

Executa uma métrica com recortes e filtros opcionais. NÃO aceita SQL: informe apenas nomes declarados no contrato. Devolve as linhas, a definição da métrica e o SQL compilado, para auditoria.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMáximo de linhas.
metricYesNome canônico da métrica.
filtersNoLista de {field, operator, value}. Operadores: eq, neq, in. Apenas campos declarados no contrato.
dimensionsNoDimensões de recorte, do contrato.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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?

With no annotations present, the description carries the behavioral burden and does disclose key traits: the SQL rejection rule, the contract-only naming constraint, and the shape of the result (rows, metric definition, compiled SQL for auditing). It omits permission/auth or rate-limit behavior, but the input/output contract is well surfaced.

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?

Three short sentences, front-loaded with the action and immediately followed by the critical constraint and the return contract. No filler; every sentence earns its place.

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 values need not be re-explained, yet the description helpfully names them. It conveys the core constraint (no SQL, contract names only) for a 4-parameter tool. Minor gap: no guidance on how to obtain valid metric/dimension/filter field names within the contract.

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?

Schema description coverage is 100%, so the schema already documents metric, filters, dimensions and limit with defaults and constraints (maxItems 3, max 10000). The description only reinforces the 'contract-declared names only' rule, adding no parameter-level detail beyond the schema baseline.

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+resource ('Executa uma métrica com recortes e filtros opcionais') and clearly separates this tool from siblings like list_metrics/describe_metric by emphasizing execution with dimensions/filters rather than listing or describing metadata.

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?

Gives a clear negative constraint ('NÃO aceita SQL: informe apenas nomes declarados no contrato'), which is essential guidance for invocation. It stops short of explicitly routing to siblings (e.g. use describe_metric first to discover names), so it is strong context but not full when/when-not coverage.

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