Skip to main content
Glama

valuation-api

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. Dates show when Glama detected each change.

  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 readOnlyHint, idempotentHint, and destructiveHint. The description adds valuable context: 'pure deterministic calculation — no side effects, no network or storage access; identical inputs always produce identical outputs.' This goes beyond the structured annotations and helps the agent understand the tool's operational profile.

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-structured with labeled sections (WHEN TO USE, WHEN NOT TO USE, BEHAVIOUR, RETURNS, PARAMETERS). Every sentence serves a purpose, and the key definition is front-loaded. Length is justified by the tool's complexity and the need to disambiguate from multiple siblings.

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?

The description covers the computation rule, parameter semantics, return shape, decimal format, sign conventions, and sibling alternatives. Since there is no output schema, the explicit 'RETURNS' section is especially valuable. Nothing critical is missing for an agent to call this tool correctly.

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%, and the schema already explains both parameters in detail, including the decimal-rate warning and the time-zero treatment. The description repeats these semantics and adds an example, but does not add substantial meaning beyond the schema.

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 states a specific verb and resource: 'Calculate the Net Present Value (NPV) of an ordered cash-flow series discounted at a given rate.' It also clarifies the time-zero treatment of the first cash flow. It clearly distinguishes itself from siblings like calculate_irr and calculate_moic by naming those alternatives for different use cases.

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 provides explicit 'WHEN TO USE' and 'WHEN NOT TO USE' sections with named alternatives (calculate_irr, calculate_moic), making it unambiguous when an agent should select this tool over its siblings.

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.

TDQS

A4.6/5.0
Disambiguation5/5

Each tool maps to a distinct financial formula or calculation, and the when-to-use/when-not-to-use guidance cleanly separates closely related cash-flow metrics like NPV, IRR, and MOIC as well as CAPM, WACC, and DCF. There is no pair of tools that appears to perform the same operation.

Naming Consistency4/5

The overwhelming majority of tools follow a consistent calculate_<metric> snake_case pattern with descriptive names. irr_sensitivity breaks the pattern by omitting the calculate_ prefix, and mixing expanded names like cost_of_equity with abbreviations like wacc and moic is a minor deviation.

Tool Count5/5

Twelve tools is well within the ideal range for a focused financial-calculations server. Each tool covers a distinct valuation, discount-rate, or return-metric need without redundancy, so the count feels appropriately scoped.

Completeness4/5

The tool set covers the core valuation workflow: cost of equity, beta unlevering/relevering, WACC, DCF, enterprise-value multiples, and investment return metrics. It lacks a reverse equity-value calculation and an equity-side multiple like P/E, but those are workable gaps rather than severe dead ends.

Resources