Skip to main content
Glama
jamejialicona-cmyk

cashflow-mcp-server

Analyze a raw cash flow vector

cashflow_analyze_flows
Read-onlyIdempotent

Compute NPV, IRR, and payback directly from a list of period cash flows. Use this when you have existing cash flow numbers and need to evaluate returns without contract modeling.

Instructions

Compute NPV, IRR and payback directly on a list of period cash flows, with no contract model involved.

Use this when the numbers already exist, for example flows lifted from a spreadsheet, a schedule produced elsewhere, or a quick sanity check.

The first element sits at period 0 and is not discounted. Outflows are negative.

Args:

  • flows (array of numbers): Cash flow per period, flows[0] at t=0. Needs at least 2 entries.

  • period ('monthly' | 'annual'): What one element represents. Default 'monthly'. Determines how the rate is annualized.

  • discount_rate_annual (number): Effective annual rate for NPV, e.g. 0.14 for 14%. Default 0.

  • interpolate_payback (boolean): Return a fractional payback period instead of whole periods. Default false.

Returns: npv, irrAnnual, irrPeriodic, irrAvailable, irrUnavailableReason, payback and cumulative totals.

irrAnnual is null when the vector has no reportable IRR: no outflow, no inflow, or flows that never sum positive. The reason says which.

A vector whose sign changes more than once may have several real IRRs. The engine returns one and flags nothing, which is a property of IRR itself. signChanges is reported so you can tell when to trust NPV instead.

Examples:

  • Use when: "What is the IRR of -1000, 500, 500, 500?"

  • Use when: "Discount these annual flows at 12% and tell me the NPV."

  • Don't use when: you have contract terms rather than flows (use cashflow_evaluate_contract)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flowsYesCash flow per period. flows[0] is period 0 and is not discounted.
periodNoWhat one element represents.monthly
interpolate_paybackNoReturn a fractional payback period instead of whole periods.
discount_rate_annualNoEffective annual discount rate, e.g. 0.14 for 14%.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
npvYes
paybackYes
netTotalYes
irrAnnualYes
irrPeriodicYes
signChangesYes
irrAvailableYes
totalInflowsYes
totalOutflowsYes
discountRatePeriodicYes
irrUnavailableReasonYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Although annotations already mark the operation as read-only and idempotent, the description adds substantial behavioral detail: flows[0] is not discounted, outflows are negative, IRR can be unavailable with specific reasons, and multiple sign changes may produce multiple IRRs. This goes well beyond the annotations and helps the agent interpret results correctly.

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?

The description is well-organized and front-loaded with the core purpose, followed by usage guidance, parameter clarifications, return behavior, and examples. Every block earns its place; there is no fluff, and the examples compactly convey common use cases.

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

Completeness5/5

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

For a financial-analysis tool with edge cases, the description covers the essential caveats: non-discounted period 0, IRR unavailability conditions, multiple IRR ambiguity, and signChanges as a trust signal. Since an output schema exists, detailed return values are not required here, but the description still provides the most important return semantics.

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 the baseline is 3, but the description adds meaningful semantics beyond the schema: period determines annualization behavior, the first element is not discounted, outflows must be negative, and discount_rate_annual uses effective annual rate with an example. It also clarifies the minimum length requirement for flows.

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?

The description uses a specific verb and resource: 'Compute NPV, IRR and payback directly on a list of period cash flows'. It clearly distinguishes itself from contract-based siblings by stating 'with no contract model involved', and the later contrast with cashflow_evaluate_contract removes ambiguity.

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?

The description explicitly states when to use the tool ('when the numbers already exist', spreadsheet flows, sanity check), gives concrete example queries, and provides a direct exclusion: 'Don't use when: you have contract terms rather than flows (use cashflow_evaluate_contract)'. This is exemplary routing guidance.

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