Money-weighted return (XIRR) from dated contributions, distributions and ending value

One command in the Portfolio pack, available in the CLI, as an MCP tool and as a JavaScript import: portfolio irr.

What it needs, and why

Every input is checked before anything is calculated. cashFlows is required; the rest refine the answer.

InputRequiredThe question it asksWhy it matters
cashFlowsyesWhat were the dated contributions (negative) and distributions (positive), plus the current value as a final flow?The rate is solved from the timing and size of each flow.

Requests it answers

An agent with this pack loaded picks the command from phrasing like that, asks for whatever input is missing, and reports the figures with the method that produced them.

Limits it inherits from wealth-portfolio

The full pack, its other 10 commands and what it deliberately leaves alone are on the Portfolio page.