Skip to main content
Glama

tvm-fund

calculate_payback_period

Read-onlyIdempotent

Calculate the payback period: how many years (including a fractional final year) until cumulative cash flows recover the initial investment, ignoring the time value of money. Formula: Payback = the year t where cumulative cash flow turns positive. WHEN TO USE: Use as a quick liquidity/risk screen — shorter payback means capital is at risk for less time. Use it only as a screening input, never as the sole investment criterion. WHEN NOT TO USE: Do NOT use as the primary decision metric — it ignores cash flows after payback, profitability, and the time value of money (use calculate_discounted_payback_period when you need a time-value-adjusted recovery measure). BEHAVIOUR: If cumulative cash flow never turns positive, an explicit error is returned ("investment is never recovered within the provided cash flows") rather than a number. RETURNS: JSON object { payback_period_years: number (e.g. 3.4), inputs }. If the cash flows never recover the investment, returns an explicit error stating no payback occurs. PARAMETERS: cash_flows (required): Ordered cash flows starting at time 0 (first element is the initial investment, typically negative), e.g. [-250000, 50000, 75000, 100000, 125000]. Must contain at least one negative (investment) followed by inflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cash_flowsYesOrdered cash flows starting at time 0 (first element is the initial investment, typically negative), e.g. [-250000, 50000, 75000, 100000, 125000]. Must contain at least one negative (investment) followed by inflows.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, and the description is fully consistent with those. It adds substantial behavioral detail beyond them: the exact error behavior when cumulative cash flows never turn positive, the return format (JSON object with payback_period_years and inputs), and the fact that TVM is intentionally ignored.

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?

The description is well-organized with labeled sections (WHEN TO USE, WHEN NOT TO USE, BEHAVIOUR, RETURNS, PARAMETERS) and front-loaded with the core definition. However, the no-recovery error case is stated twice (in BEHAVIOUR and again in RETURNS), and the formula sentence partially overlaps with the opening definition, making it slightly redundant.

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?

With only one parameter and no output schema, the description fully compensates: it documents the exact input format, the edge case of non-recovery, the return object shape, and the intended use context. Nothing an agent needs to correctly invoke this tool is missing.

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 coverage is 100%, and the schema description already documents the cash_flows array, the time-0 convention, the example array, and the requirement of a negative investment followed by inflows. The description's PARAMETERS section repeats this rather than adding new meaning, so it provides no additional value beyond the structured 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 payback period' with the precise condition under which it is computed (until cumulative cash flows recover the initial investment, ignoring time value of money). It explicitly names the alternative sibling calculate_discounted_payback_period, making it unambiguous which tool is which.

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 has dedicated 'WHEN TO USE' and 'WHEN NOT TO USE' sections, clearly framing the tool as a screening input rather than a sole decision metric and directing users to calculate_discounted_payback_period when time-value adjustment is needed. This provides explicit exclusions and alternatives, leaving nothing to inference.

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