Skip to main content
Glama
Analytics MCP Server

Analytics MCP Server

by piyusht007

query_kpi

Read-onlyIdempotent

Compute a KPI over an inclusive date range with optional dimension grouping, time grain, and value filters, returning result rows plus generated SQL for transparency.

Instructions

Compute a KPI for an inclusive date range (YYYY-MM-DD), optionally grouped by catalog dimensions and/or a time grain ('day', 'week', 'month') and filtered by dimension values, e.g. filters={"queue": ["billing"]}. Returns rows plus the generated SQL for transparency.

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": {
      "kpi": "<kpi>",
      "start": "<start>",
      "end": "<end>"
    },
    "name": "query_kpi"
  }
}

Input Schema

NameRequiredDescriptionDefault
endYes
kpiYes
startYes
filtersNo
group_byNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, closed-world behavior, so the bar is lower; the description still adds that the date range is inclusive, that start/end are YYYY-MM-DD, the allowed time grains, and that results include the generated SQL. That transparency about derivable output is genuinely useful extra context rather than a restatement of the hints.

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 core operation is front-loaded in the first clause, and the optional behaviors follow in a logical order with a concrete inline example. It is a single dense paragraph with little waste, though the inline example makes it slightly harder to scan than a structured list would be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the description needn't detail return values, and the annotations cover the safety profile. However, with 5 parameters at 0% schema coverage, the definition leaves the agent guessing which KPI identifiers and which "catalog dimensions" are valid, with no pointer to list_kpis or describe_kpi to resolve that.

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 description coverage is 0% and the schema only supplies bare titles, so the description carries the full load — and it does: it fixes the date format and inclusivity, enumerates the time-grain values, and shows the filter object shape with a concrete example ({"queue": ["billing"]}). The main gap is the "kpi" identifier itself, whose valid values or source are never explained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ("Compute a KPI") and scopes it to an inclusive date range, so the operation is unambiguous. It does not name any sibling (e.g. list_kpis or describe_kpi) to sharpen the boundary, so it falls short of full sibling differentiation.

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?

Usage is implied by the phrasing "optionally grouped by... and/or a time grain... and filtered by dimension values," which tells the agent what the tool supports. There is no explicit statement of when to prefer this over compare_periods or explain_change, and no stated preconditions.

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