Skip to main content
Glama

Build Kpi Config

build_kpi_config

Builds a complete KPI configuration dictionary for ui_config.json from SQL, label, icon, format, and hex card color inputs so dashboard KPI cards render correctly.

Instructions

Build a complete KPI config dict for ui_config.json.

Note: The color field in KPIs IS a hex color for the card background (e.g. "#246bfd"). This is different from charts where color is a column name.

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": "build_kpi_config"
  }
}

Input Schema

NameRequiredDescriptionDefault
kpi_jsonYesJSON string with KPI parameters: { "sql": "SELECT SUM(total_usd) FROM sales", "label": "Total Sales", "icono": "payments", "formato": "money", "color": "#246bfd" }

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. It does not say whether the config is written to ui_config.json or merely returned, whether it validates or mutates existing state, or what happens on a malformed kpi_json; only the `color` semantic gotcha is disclosed.

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?

Two short sentences, front-loaded with the purpose and followed by the one non-obvious caveat. Nothing is redundant or padded.

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 and the single parameter is fully documented, so return values need no explanation. However, the persistence question (does this write to ui_config.json?) and the relationship to validate_config/generate_config are left unaddressed for what appears to be a config-generation tool.

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 single parameter already carries a full example JSON with sql, label, icono, formato, and color. The description adds genuine meaning only for `color`, explaining it is a hex card background rather than a column name.

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?

States a specific verb and resource: 'Build a complete KPI config dict for ui_config.json.' The note contrasting KPI `color` (hex background) with chart `color` (column name) implicitly separates it from build_chart_config, though the sibling is never named.

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 explicit when-to-use guidance, no prerequisites, and no named alternative. The only routing signal is the indirect 'this is different from charts' remark, which an agent must infer into a choice between build_kpi_config and build_chart_config.

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