Skip to main content
Glama

swiftpesa

Run a calculator

run_calculator
Read-onlyIdempotent

Use for calculations that have no dedicated tool: loan repayments {principal, rate, months}, savings and money market growth {principal, monthly, years, rate}, PesaLink bank fees {amount, bank}, SACCO dividends {shares, deposits}, or a specific calculator such as Kenya's NSSF-only calculator. Needs a slug from list_calculators; get_calculator_rules lists each calculator's inputs. For salaries prefer get_take_home_pay, and for mobile money prefer get_mobile_money_fees. Returns the breakdown and a one-sentence summary.

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": {
      "slug": "<slug>",
      "inputs": "<inputs>"
    },
    "name": "run_calculator"
  }
}

Input Schema

NameRequiredDescriptionDefault
slugYesCalculator slug, e.g. kenya-mortgage-loan-calculator.
inputsYesInputs by name, e.g. {"principal": "5m", "rate": 14, "months": 240}.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered; the description adds value by disclosing the return shape ('breakdown and a one-sentence summary') and the data-flow prerequisite of resolving rules before calling. It does not say what happens on an invalid slug or an unrecognized input key, which is the main residual gap for a dispatcher-style tool.

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?

Front-loaded with the use condition, then examples, then prerequisites, then exclusions and return shape — a logical order with no filler. The enumerations of calculator types and inputs are long but each maps to a selection decision, so they mostly earn their 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?

For a generic dispatcher with a nested free-form inputs object and no output schema, the description covers when to use it, how to obtain the slug and input names, and what it returns. Missing only failure-mode guidance (bad slug, unsupported input key), which would round out an otherwise complete definition.

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 coverage is 100%, so both parameters are documented structurally, but the description adds real meaning: the slug must come from list_calculators, the input names must be discovered via get_calculator_rules, and it shows input-set examples per calculator type (principal/rate/months, principal/monthly/years/rate). That goes beyond the generic 'inputs by name' schema text.

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 and resource ('calculations') and enumerates concrete use cases (loan repayments, savings growth, PesaLink fees, SACCO dividends, NSSF calculator) so an agent can match a task to it immediately. It also explicitly distinguishes itself from siblings by naming the dedicated tools that should be used instead.

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

Usage Guidelines5/5

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

Gives an explicit use condition ('calculations that have no dedicated tool'), names two alternatives with their selecting conditions (get_take_home_pay for salaries, get_mobile_money_fees for mobile money), and states the prerequisite workflow: slug from list_calculators, input names from get_calculator_rules.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources