Skip to main content
Glama

Get Kpi

get_kpi

Execute a JSON-configured KPI query and return one computed value for dashboard reporting.

Instructions

Execute a KPI query and return a single value.

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_json": "<kpi_json>"
    },
    "name": "get_kpi"
  }
}

Input Schema

NameRequiredDescriptionDefault
kpi_jsonYesJSON string with KPI config, e.g.: { "sql": "SELECT COALESCE(SUM(total_usd), 0) AS v FROM sales", "label": "Total Sales", "formato": "money" }

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It discloses only that the call returns one value; it says nothing about the fact that the input is raw SQL that will be executed (read-only? permissioned? arbitrary?), how errors or empty result sets are handled, or whether the call is side-effect free.

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?

A single front-loaded sentence with zero filler and a clear statement of the return shape. It is efficient, though the brevity edges toward under-specification rather than optimal density.

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

Completeness2/5

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

The output schema and fully described parameter reduce what the description must cover, but for a tool that executes a caller-supplied SQL string with no annotations and no usage routing, the definition leaves out the two things an agent most needs: when to prefer it over run_query, and what executing arbitrary SQL implies.

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 coverage is 100% and the schema itself embeds a worked example of kpi_json with sql, label, and formato fields, so parameter meaning is already well established. The description adds nothing beyond that, which is acceptable at full coverage but earns no extra credit.

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 names a specific verb ('Execute') and resource ('KPI query') and states the return shape ('a single value'), so the agent knows exactly what it gets back. It does not, however, distinguish this from siblings such as run_query, run_query_with_filters, or build_kpi_config, which likely operate on the same kpi_json artifact.

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

Usage Guidelines2/5

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

There is no guidance on when to call this versus run_query or run_query_with_filters, and no mention that build_kpi_config is presumably the tool that produces the kpi_json this one consumes. The agent must infer the workflow entirely from sibling names.

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