Skip to main content
Glama

Tasa interna de retorno (TIR)

fin-irr
Read-onlyIdempotent

Calcula la tasa interna de retorno de flujos periódicos; null si no hay cambio de signo. Cuándo: un cálculo de dinero, impuestos o matemática financiera tiene que ser exacto y reproducible (redondeo, centavos, tasas). No para: calcular la TIR anualizada para flujos en fechas irregulares (fin-xirr). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Computes the internal rate of return of periodic cash flows (Newton-Raphson with bisection fallback); returns null when no sign change exists. When: a money, tax or financial-math result has to be exact and reproducible (rounding, cents, rates). Not for: computing the annualized internal rate of return for cash flows on arbitrary dates (fin-xirr). Side effects: none (read-only, no network access, no stored state). [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
guessNoInitial guess (number; optional; default 0.1; min -0.99; max 10).
cash_flowsYesCash flows; index 0 is time 0 (array of number; required; at least 2 items; up to 1000 items).

Output Schema

NameRequiredDescriptionDefault
irrNo
reasonNo
irr_percentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / cash_flows / examples
      Added value: +[
      +  [
      +    -1000,
      +    300,
      +    400,
      +    500
      +  ]
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Computes the internal rate of return of periodic cash flows (Newton-Raphson with bisection fallback); returns null when no sign change exists. When: a money, tax or financial-math result has to be exact and reproducible (rounding, cents, rates). Not for: computing the annualized internal rate of return for cash flows on arbitrary dates (fin-xirr). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: the numeric method (Newton-Raphson with bisection fallback), the null-on-no-sign-change outcome, determinism, and hard limits (64 KB input, 1 s per call, 1 MB result). The "no side effects / read-only / no network" sentence largely restates the readOnlyHint and openWorldHint annotations, so it earns a 4 rather than a 5.

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?

Strongly front-loaded: purpose, then when, then not-for, then effects and limits. The cost is a full bilingual duplication (with the EN half truncated to a pointer to inputSchema.description), which roughly doubles length without adding information.

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 an output schema (so return shape needs no explanation), rich annotations, and only two parameters, this covers everything an agent needs: what it computes, when to pick it, the sibling alternative, failure semantics, and runtime limits.

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 "periodic cash flows" adds a semantic constraint on cash_flows (uniform period spacing) that the schema itself does not state. The optional guess parameter and its Newton-Raphson role are left entirely to 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?

States a specific verb and resource ("computes the internal rate of return of periodic cash flows") plus the failure mode ("returns null when no sign change exists"). It explicitly separates itself from the nearest sibling, fin-xirr, so an agent can disambiguate without opening schemas.

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?

Explicit "When:" clause scopes it to money/tax/financial-math calculations needing exact, reproducible results, and an explicit "Not for:" clause names fin-xirr with the distinguishing condition (annualized IRR on irregular dates). Both the positive and negative routing conditions are present.

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