Skip to main content
Glama

XIRR from dated transactions

calculate_xirr
Read-onlyIdempotent

XIRR (annualised return) on investments made on different dates, such as mutual fund SIP instalments, top-ups and withdrawals, from a list of dated transactions and the holding's current value. Same definition as Excel's XIRR (actual days / 365). Also returns total invested, withdrawn, gain and absolute return.

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": {
      "transactions": "<transactions>",
      "current_value": "<current_value>"
    },
    "name": "calculate_xirr"
  }
}

Input Schema

NameRequiredDescriptionDefault
value_dateNoDate of current_value as YYYY-MM-DD (default: today in India)
transactionsYesEach investment or withdrawal, in any order
current_valueYesWhat the holding is worth now, in rupees (0 if fully withdrawn)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/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 burden is lifted. The description adds real value beyond them by pinning the calculation convention (actual days / 365, matching Excel's XIRR) and by naming the supplementary outputs (total invested, withdrawn, gain, absolute return) that the agent would otherwise not know it receives.

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?

Two sentences, front-loaded with the definition and then the return values; nothing is wasted. The opening acronym-plus-gloss is slightly repetitive with the title but functions as a self-contained definition.

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?

With no output schema, the description usefully enumerates what comes back (XIRR plus invested, withdrawn, gain, absolute return). What is missing is behavior on degenerate inputs, such as when XIRR is undefined because all cash flows share a sign or the result fails to converge.

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 description coverage is 100%, so the baseline is 3 and the schema already documents formats, defaults, the invest/withdraw enum and amount bounds. The description only restates the parameter roles in narrative form ('from a list of dated transactions and the holding's current value') without adding syntax or edge-case meaning.

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+resource: computes XIRR (annualised return) from a list of dated transactions plus current value, and clarifies the cash-flow pattern (SIP instalments, top-ups, withdrawals). It is clear what the tool does, but it does not differentiate itself from the sibling `xirr_calculator`, which an agent could plausibly pick instead.

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 examples of cash-flow patterns (SIP instalments, top-ups, withdrawals) rather than stated as conditions. There is no guidance on when to prefer this over `xirr_calculator`, `cagr_calculator`, or `lumpsum_calculator` for a single-point investment, 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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources