Where a gain falls across the 0/15/20 bands once it is stacked on ordinary income
One command on the Federal income tax server, callable over MCP as calculate_capgains, filed in the registry as Capital gain. Every result carries the method it used, the rule pack it was pinned to, what is still missing and whether coverage was complete, for a licensed professional to review.
What it needs, and why
Every input is checked before anything is calculated. Nothing is required to start, and a field left blank means do not apply this rather than zero.
| Input | What it asks for | Why it matters | If you omit it |
|---|---|---|---|
gain | Net long-term gain | This is the gain being analysed: where it falls across the 0, 15 and 20 per cent bands is the answer. | defaults to 100000 |
ordinary | Ordinary taxable income | A gain is stacked on ordinary taxable income, so the same gain falls in different bands at different incomes. | defaults to 90000 |
status | Filing status one of MFJ, SINGLE, HOH, MFS | Every band, threshold and exemption in the calculation is set by filing status. | defaults to MFJ |
Requests it answers
- “What rate will my long-term capital gain be taxed at?”
- “Can one gain be taxed at two different rates?”
An agent with these skills loaded picks the command from phrasing like that, asks for whatever input is missing, and reports the figures with the method that produced them.
Run it
python3 -m taxagent federal capgains --gain 100000 --ordinary 90000 --status MFJThe same command is exposed by taxagent-federal, so Claude, Claude Code, Codex, Cursor and any other MCP client can call it directly. Analysis only. No tool in this server places orders, modifies custodian records or files returns. This server holds no client data: every figure arrives in the call and nothing is stored. Results are estimates over those figures, not a return and not tax advice.
Scripted cases that exercise it
2 of the 71 console cases call this command on a real server over JSON-RPC and assert the outcome. Every one runs on every build, and all of them are listed on the case inventory.
| Case | What it asks | What it shows | Outcome |
|---|---|---|---|
federal-gain-splits | A gain that straddles the 0% and 15% bands | The gain is split across bands rather than taxed wholly at the rate its top dollar reaches. This is the error the legacy code made. | completed |
federal-rejects-float | A figure that cannot be represented exactly is refused | Money is decimal. A value that would silently lose a fraction of a cent is rejected at the boundary rather than rounded quietly. | VALIDATION_FAILED |
Limits it inherits from taxagent-federal
- A return. AMT and the section 199A deduction are computed separately and are not folded into one liability.
- Credits, self-employment tax and the additional Medicare tax.
- State and local tax.
The server, its other 6 commands and what it deliberately leaves alone are on the Federal income tax page.