Skip to main content
Glama

Custom Solutions

Internal rate of return (IRR)

compute_irr
Read-onlyIdempotent

Internal rate of return of a series of cash flows, per period, with the equity multiple and every rate that sets the net present value to zero. IRR is where calculators silently disagree: a series with no sign change has no IRR at all, and one that changes sign more than once can have several; this engine refuses the first with a named reason and lists every root of the second. Send cash_flows as comma-separated numbers, period 0 first, with money put in as negative numbers, for example -100000,8000,8500,9000,9500,130000. Yearly flows give a yearly IRR.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cash_flows": "<cash_flows>"
    },
    "name": "compute_irr"
  }
}

Input Schema

NameRequiredDescriptionDefault
cash_flowsYesComma-separated cash flows, period 0 first, e.g. -100000,8000,8500,9000,9500,130000

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already establish that this is a safe, read-only, idempotent operation. The description adds meaningful behavior beyond that: it refuses a series with no sign change with a named reason, lists every root when sign changes occur multiple times, and returns the equity multiple alongside the IRR. It does not fully specify output formatting or numerical tolerance, which keeps it from 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?

The description front-loads the purpose and output contents, then covers edge-case behavior and input format. It is somewhat verbose, and the rhetorical clause 'IRR is where calculators silently disagree' is not strictly necessary, but the remaining sentences carry useful information.

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 one-parameter, non-destructive calculation tool with no output schema, the description does the important work of explaining return contents and edge-case behavior. It is largely complete, though it could state empty or single-flow handling and any numerical tolerance expectations.

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%, so the input schema already documents the sole cash_flows parameter with the same comma-separated format and example. The description adds the semantic convention that yearly flows produce a yearly IRR, but otherwise largely restates what the schema provides. A baseline 3 is appropriate.

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 computation and its outputs: the internal rate of return of a cash-flow series, 'per period, with the equity multiple and every rate that sets the net present value to zero.' It also distinguishes this tool's behavior from generic IRR calculators by describing how it handles no-sign-change and multiple-sign-change series. No sibling in the provided list competes for the same operation, so no further differentiation is needed.

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 is implied by the purpose and the cash-flow input instructions, but there is no explicit when-to-use or when-not-to-use guidance relative to alternatives such as compute_cash_on_cash. The edge-case discussion helps an agent understand applicability, but it is behavioral context rather than routing 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