acb-tax-mcp

v0.5.0
io.github.haiiibin/acb-tax-mcp Checked 19 hours ago Published 1 month ago

Canadian ACB and capital gains: average-cost, per-disposition gains, superficial-loss detection.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

calculate_acb

Compute adjusted cost base and capital gains for a set of trades (Canadian rules). Runs the full calculation and returns: current holdings (shares, total ACB, ACB per share) per security; every disposition with proceeds, ACB, outlays, the gain before and after the superficial-loss rule, and whether it was a superficial loss; per-tax-year summaries with net and taxable capital gain; and any warnings. Uses the CRA average-cost method (all shares of a security pool into one ACB; gains are computed against the average, not FIFO). Pass trades either inline as 'tran…

ParameterTypeDescription
csv_path
transactions

acb_summary

Show current holdings: shares, total ACB and ACB per share for each security. A lighter view than calculate_acb when you only want the current book cost of what is still held (for example to compute an unrealized gain against a market price). Accepts inline 'transactions' or a 'csv_path'. Each transaction is an object: date (YYYY-MM-DD), action ('buy' or 'sell'), security (ticker/symbol), shares, price (per share), and optionally commission, currency, fx_rate (trade-currency to CAD, e.g. 1.35 for USD), and note.

ParameterTypeDescription
csv_path
transactions

capital_gains_report

Produce a capital-gains report for a single tax year (Schedule 3 style). Returns every disposition dated in 'tax_year' with proceeds, ACB, outlays and the allowable capital gain/loss, plus totals: total proceeds, total ACB, net capital gain, and the taxable capital gain (net gain times the 50% inclusion rate). Superficial losses are already applied. Accepts inline 'transactions' or a 'csv_path'. Each transaction is an object: date (YYYY-MM-DD), action ('buy' or 'sell'), security (ticker/symbol), shares, price (per share), and optionally commission, currency, fx_rate (trade…

ParameterTypeDescription
tax_year *integer
csv_path
transactions

schedule3_summary

One row per security in the shape of Schedule 3's publicly traded shares section. Aggregates dispositions (optionally limited to 'tax_year') into one line per security with the columns transcribed onto Schedule 3: number of shares, proceeds of disposition (gross, before commissions), adjusted cost base, outlays and expenses (sale commissions), and gain or loss with the superficial-loss rule already applied, plus acquisition years, per-column totals, and the list of years that have dispositions. capital_gains_report lists every individual disposition; use this tool…

ParameterTypeDescription
csv_path
tax_year
transactions

check_superficial_losses

Flag superficial losses under the CRA 30-day (61-day window) rule. Scans dispositions for losses where the same security was bought within 30 days before or after the sale and still held at the end of that window. For each, reports the security, date, the denied (deferred) loss amount and the allowable portion. The denied amount is added to the ACB of the substitute shares. Accepts inline 'transactions' or a 'csv_path'. Each transaction is an object: date (YYYY-MM-DD), action ('buy' or 'sell'), security (ticker/symbol), shares, price (per share), and optionally commission,…

ParameterTypeDescription
csv_path
transactions

unrealized_gains

Compute unrealized gains: current holdings' book cost (ACB) against market prices. For each security still held, returns shares, total ACB, current market value and the unrealized gain in dollars and percent, plus portfolio totals. 'market_prices' maps each security to its current price: either a number already in CAD (e.g. {"XEQT": 35.20}) or, for foreign-quoted securities, an object with the trade-currency price and the CAD exchange rate (e.g. {"VTI": {"price": 305.40, "fx_rate": 1.37}}). Held securities without a price are listed in 'missing_prices' and excluded…

ParameterTypeDescription
market_prices *object
csv_path
transactions

normalize_broker_csv

Convert a raw broker activity export into transactions the other tools accept. Broker exports rarely match the documented headers. This tool maps common column aliases ("Trade Date", "Activity Type", "Symbol", "Quantity", ...), keeps only buy/sell rows (reinvestment/DRIP rows count as buys, since they add to ACB), cleans number formats ("1,200", "$9.99", parenthesized negatives, signed quantities), and returns ready-to-use 'transactions' plus a per-row 'skipped' list (dividends, deposits, transfers, unparseable rows) with reasons, so nothing is dropped silently. Pa…

ParameterTypeDescription
csv_path
rows