Skip to main content
Glama

finance.irr

Read-onlyIdempotent

Calculate the internal rate of return from a series of cash flows by finding the rate that sets net present value to zero, returning convergence status or null when no solution is found.

Instructions

내부수익률(IRR), 즉 NPV 를 0 으로 만드는 기간 수익률을 구한다. cashflows 는 2개 이상이며 index 0 이 t=0, 양수와 음수가 모두 있어야 한다. 뉴턴법이 실패하면 -0.99 이상 10 이하 구간 이분법을 쓰고 max_iter 는 10000 이하. 해를 못 찾으면 irr=null, converged=false 를 돌려준다. 월별 현금흐름의 결과는 연율이 아니라 월 수익률이다.

Input Schema

NameRequiredDescriptionDefault
tolNo1e-10
guessNo0.1
max_iterNo
cashflowsYes

Output Schema

NameRequiredDescriptionDefault
irrYes
_metaNo서버가 붙이는 영수증(integrity), 엔진, 힌트
traceYes계산 근거(tool, formula, inputs, steps, output)
convergedYes
iterationsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations only declare readOnly/idempotent/closed-world, but the description goes far beyond: it names the primary solver (Newton), the bisection bracket (-0.99 to 10) used on failure, the max_iter ceiling of 10000, the failure contract (irr=null, converged=false), and the critical unit caveat that monthly cash flows yield a monthly rather than annualized rate. These are exactly the behavioral traits an agent cannot infer from structured fields.

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?

Front-loaded with the definition, then constraints, then failure behavior, then the units caveat — a sensible order with no filler. The Newton/bisection sentence is somewhat implementation-detail heavy, but it justifies the max_iter limit and the convergence flag, so it largely earns its place.

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

Completeness4/5

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

For a 4-parameter numerical solver with a defined output schema, the description covers the input domain constraints, solver robustness, failure signaling, and rate-frequency ambiguity. The only remaining gap is that 'tol' and 'guess' are never explained, which matters for an iterative root-finder where a bad guess can trigger the bisection fallback.

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 0%, so the description must carry parameter meaning; it does so for 'cashflows' (ordering, sign constraints, minimum length) and 'max_iter' (upper bound), which are the parameters most likely to cause errors. It says nothing about 'tol' or 'guess', leaving two of four parameters undocumented anywhere.

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?

States a precise verb+resource: computes IRR, defined explicitly as the periodic rate where NPV = 0, which also draws a clear conceptual line to the sibling finance.npv. The agent knows exactly what mathematical result is produced without opening the schema.

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

Usage Guidelines3/5

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

Usage conditions for the inputs are stated (cashflows ≥ 2, index 0 = t=0, must contain both positive and negative values), which effectively tells the agent this tool fails on all-positive or all-negative streams. However, there is no explicit routing versus alternatives such as finance.npv, finance.cagr, or finance.bond_ytm, so sibling selection is left to inference.

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

Deploy Server

Other Tools