Skip to main content
Glama

valuation-api

This connector has been deprecated

Superseded by valuation-api on valuation.finance-tools.io (fresh connector with focused 12-tool set and current TDQS eval)

calculate_npv

Read-onlyIdempotent

Calculate the Net Present Value (NPV) of an ordered cash-flow series discounted at a given rate. The first cash flow is treated as time 0 and is NOT discounted (typically the negative initial investment). WHEN TO USE: to evaluate whether an investment creates or destroys value at a required discount rate, or to compare competing projects on a present-value basis when you have a full cash-flow schedule. WHEN NOT TO USE: for a single lump-sum investment with one exit value (use calculate_irr), or when you only need a money multiple with no time value (use calculate_moic). BEHAVIOUR: pure deterministic calculation — no side effects, no network or storage access; idempotent and non-destructive; identical inputs always produce identical outputs. RETURNS: JSON object { npv: number rounded to 2dp, rate, cash_flows }. A positive NPV means the investment clears the discount-rate hurdle. PARAMETERS: rate (decimal discount rate, e.g. 0.10 = 10% — express as a decimal, never as percentage points), cash_flows (ordered number array starting at time 0; negative values are investments/outflows, positive values are distributions/inflows), e.g. [-100000, 0, 0, 0, 0, 250000].

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rateYesDiscount rate as a decimal, e.g. 0.10 = 10%. Never pass percentage points (10 is invalid for 10%).
cash_flowsYesOrdered cash flows starting at time 0 (first element is not discounted). Negative = investment/outflow, positive = distribution/inflow. Example: [-100000, 0, 0, 0, 0, 250000].

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

The description goes beyond the annotations by stating the calculation is 'pure deterministic' with 'no side effects, no network or storage access,' and that 'identical inputs always produce identical outputs.' It also discloses the return format and interpretation of positive NPV, adding real behavioral context beyond readOnlyHint and idempotentHint.

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 organized into clear labeled sections: WHEN TO USE, WHEN NOT TO USE, BEHAVIOUR, RETURNS, and PARAMETERS. It front-loads the core definition and every section earns its place without filler or redundancy.

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?

Although there is no output schema, the description fully documents the return object shape and numeric rounding, plus the meaning of a positive NPV. Combined with full input schema coverage and safety annotations, nothing needed to invoke the tool correctly is missing.

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 reinforcement: it explains rate must be a decimal rather than percentage points, defines cash-flow sign conventions, notes the first cash flow is not discounted, and gives a concrete example. It largely mirrors the schema but adds the typical initial-investment framing.

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 opens with a specific verb and resource: 'Calculate the Net Present Value (NPV) of an ordered cash-flow series discounted at a given rate.' It explains the time-0 non-discounting convention and distinguishes itself from siblings in the WHEN NOT TO USE section by naming calculate_irr and calculate_moic.

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?

WHEN TO USE explicitly describes investment evaluation and project comparison, while WHEN NOT TO USE names specific alternatives and the conditions that should route to them, such as single lump-sum investments going to calculate_irr. This is direct, actionable guidance.

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