Skip to main content
Glama
Microfinance Warehouse MCP Server

Microfinance Warehouse MCP Server

compute_kpi

Read-onlyIdempotent

Computes official microfinance KPIs—including PAR30, PAR90, and outstanding portfolio—from warehouse data using dates, periods, groupings, and filters.

Instructions

Compute an official KPI.

kpi: one of outstanding_portfolio, par30, par90, active_loans, active_clients, disbursed_amount, disbursed_loans, average_loan_size, written_off_amount, on_time_repayment_rate. as_of: date for snapshot KPIs (YYYY-MM-DD, default 2025-12-31). start, end: period for flow KPIs (YYYY-MM-DD, inclusive). group_by: dimensions among branch, governorate, region, product, segment, gender, sector, and for flow KPIs month, quarter, year. filters: dimension -> value, e.g. {"region": "South"}.

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>"
    },
    "name": "compute_kpi"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNo
kpiYes
as_ofNo
startNo
filtersNo
group_byNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds the notion of 'official' KPI definitions and the closed set of valid KPI and dimension values, but says nothing about error behavior for unsupported KPIs, case sensitivity, or what the computed result contains. With annotations carrying the behavioral load, a 3 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.

Conciseness4/5

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

The description is a compact, front-loaded verb statement followed by a labelled parameter dictionary; every line contributes information and there is no filler. The multi-line layout is readable, though the trailing newline and indentation make it slightly less tidy than a single tight paragraph.

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?

With six parameters and no output schema, the description adequately covers inputs but leaves the agent without any sense of the return shape (rows, columns, grouped structure) or how results are keyed when group_by is used. The absence of guidance on when this should replace run_sql is also a completeness gap for a tool with a broad sibling.

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%, so the description carries the full burden and largely succeeds: it enumerates the ten valid kpi values, explains as_of vs start/end for snapshot vs flow metrics, lists the permitted group_by dimensions (with month/quarter/year only for flow KPIs), and gives a filters example. The only flaw is the stated as_of default of 2025-12-31, which conflicts with the schema's default of null, and the absence of format constraints on the date strings.

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 ('Compute an official KPI') and enumerates the ten allowed KPI identifiers, so the agent knows exactly what operation and metric space it covers. It does not explicitly distinguish itself from run_sql, which is the most plausible overlapping sibling, so it stops short of a 5.

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 through parameter semantics: 'as_of' is labelled for snapshot KPIs and 'start, end' for flow KPIs, which tells the agent which temporal parameters to pick per KPI type. However, there is no explicit statement of when to use this tool versus run_sql or get_glossary, and no exclusion or prerequisite guidance.

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

Deploy Server

Other Tools