Skip to main content
Glama

npv-calculator

Read-onlyIdempotent

Compute Net Present Value (NPV) and Internal Rate of Return (IRR) for a series of cashflows discounted at a given rate. Returns NPV, an Accept/Reject decision, IRR, and a per-period present-value breakdown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cashflowsYesExpected cashflows for periods 1, 2, …, N. Index 0 is period 1. Negative values are allowed (mid-life capex). Must contain at least one entry.
initial_investmentYesPeriod-0 outlay as a positive number (e.g. 10000 for a $10,000 upfront cost). Subtracted from the discounted-cashflow sum.
discount_rate_percentYesPer-period discount rate as a percentage (e.g. 10 for 10%). Must be greater than −100. Negative rates are allowed but unusual.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
npvYesNet Present Value. Positive → accept; negative → reject; zero → indifferent.
periodsYesPer-period breakdown.
decisionYesPlain-language verdict. Accept when NPV > 0, Reject when NPV < 0, Break-even when |NPV| < 0.01.
irr_percentYesInternal Rate of Return as a percentage. The discount rate that makes NPV = 0. Null when no IRR exists in [-99%, +10000%] (e.g. all cashflows are negative).
total_inflowsYesSum of all cashflows in periods 1..N (undiscounted).
total_pv_inflowsYesSum of all present values in periods 1..N.
initial_investmentYesEchoed back.
discount_rate_percentYesEchoed back.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds useful return-value context (Accept/Reject decision, breakdown) but does not disclose any edge-case behaviors, such as the NPV decision rule (e.g., accept if NPV >= 0) or handling of multiple IRRs. This is acceptable given the strong annotations, but it leaves some behavioral traits undocumented.

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 two sentences, front-loaded with the core action, and contains zero filler. Every sentence earns its place: the first states the primary function, the second lists the return values. This is an ideal level of conciseness.

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?

Given the tool's low complexity, comprehensive schema descriptions, presence of an output schema, and strong annotations, the description is complete. It covers the purpose, inputs, and outputs sufficiently for an agent to select and invoke the tool correctly. No critical gaps remain.

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%, with each parameter (initial_investment, discount_rate_percent, cashflows) already having detailed descriptions. The tool description adds no additional parameter semantics beyond restating 'cashflows discounted at a given rate.' Per the calibration baseline, a score of 3 is appropriate when the schema fully covers parameter meaning.

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 clearly states the tool's purpose with specific verbs and resources: 'Compute Net Present Value (NPV) and Internal Rate of Return (IRR) for a series of cashflows discounted at a given rate.' It also lists the outputs (NPV, Accept/Reject decision, IRR, per-period present-value breakdown), fully distinguishing it from sibling tools like loan-calculator or discount-calculator.

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

Usage Guidelines4/5

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

The description provides clear context on what the tool does, which implies when to use it (for NPV/IRR calculations). It does not explicitly name alternatives or exclusions, but the sibling list contains no other financial-calculator tools, so confusion is unlikely. A minor gap is the lack of explicit 'when not to use' guidance, but the purpose is unambiguous.

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