DocumentationReference

MCP tools reference

Generated by scripts/docgen/mcp-tools. Do not edit by hand — run make docs-regen after changing internal/mcp/tools.go.

These are the tools canary mcp exposes to MCP clients (Claude Code, Claude Desktop, or any other MCP host). Every public tool uses the canonical canary_* namespace. Each entry lists the tool name an LLM picks against, the description the LLM reads to decide whether to invoke, and the parameter schema the LLM binds against.

42 tools total. Listed in registration order, aligned with the agent-appropriate CLI commands. Local lifecycle commands such as setup, update, restart, mcp, daemon, and version are intentionally excluded from MCP tools.

canary_add

Calculate the permitted whole-share addition to a selected stock, including opening from a watchlist with no holding. Canary reads actual positions, other exposure, outstanding orders, cash reserves, approved allocation limits and risk budgets. Provide an explicit currency and limit price; choose a positive additional quantity or max=true explicitly. The result separates stock allocation room from the order allowance, exact cash and margin checks, risk evidence and working stop coverage. Missing inputs or unapproved policy hold the plan; a bounded maximum search may return a checked quantity without establishing a maximum. Read-only planning may request a broker WhatIf fee estimate; it returns no preview token, reserves no money and cannot submit, modify or authorise an order. Use canary_positions for holdings, canary_rules for risk explanations, and the owner CLI's add preview for an exact order review. Not for options, bonds, shorts, stock selection, recurring purchases or an investment recommendation.

Parameters:

Name Type Required Description
con_id integer no Exact broker stock contract ID when known.
currency string yes Explicit stock trading currency, for example USD or EUR; no automatic conversion.
limit_price number yes Maximum price per share in the specified currency.
max boolean no Explicitly request the maximum for one order. Mutually exclusive with quantity; no automatic execution.
quantity integer no Exact additional whole shares. Choose this or max=true; never the current position or a target total.
symbol string yes Selected stock symbol, case-insensitive; membership of a watchlist does not authorise a purchase.

canary_portfolio_plan

Read the next portfolio action under an explicit owner-approved target-band mandate. Canary combines current holdings and the accepted watchlist, applies target bands, entry regimes and priority, and considers existing reductions and protection before sizing one stock addition. Returns hold or cannot-evaluate reasons, desired quantities separately from the checked next order, source evidence and unassigned stocks. Recalculate after each broker outcome; later candidates have no reserved allowance and projected sale proceeds are not spendable cash. Takes no caller-supplied holdings, targets, limits or authority. Read-only; may request bounded broker WhatIf fee and margin checks, but never refreshes the proposal executor, mints an order token, reserves cash or submits. Use canary_portfolio for composition and canary_add for one selected stock's sizing. Not autonomous trading or support for new option, bond or short positions.

No parameters.

canary_short_interest_screen

Discover US equities (including listed funds and OTC) with large reported short positions using FINRA's twice-monthly public publication. Filters and sorting apply before limiting results; default ranks short shares, not percent of float. Free float is unavailable. Settlement date is distinct from fetch time; failed refreshes retain stale publication provenance. FINRA days to cover is floored at 1 and average daily shares covers the reporting interval. Optional recent price and 20-session dollar-turnover context is bounded background acquisition with explicit partial coverage, not an all-market liquidity guarantee. Short interest is neither daily short-sale volume nor borrowing cost. Use canary_lending_screen for borrower fees, canary_lending_fees for earned lending income. Displayed rows get bounded price-first priority; missing borrowing-feed identities may use unique exact session-bound USD stock resolution. Unsupported or ambiguous symbols remain unavailable, with no suffix or issuer-name guesses. Read-only; no orders, enrollment, subscriptions or policy changes.

Parameters:

Name Type Required Description
exclude array no Case-insensitive symbols to omit, default empty
limit integer no Maximum results after filtering and sorting; default 50
listed_only boolean no Exclude OTC rows; listed funds remain included; default false
min_average_volume integer no Minimum FINRA reporting-cycle average daily shares, not 20-session volume; default 0
min_avg_dollar_volume_20d number no Minimum covered 20-completed-session average USD turnover; default 0 disables
min_days_to_cover number no Minimum FINRA days to cover; published values at or below one floor at 1; default 0
min_price number no Minimum covered USD price; unknown values excluded; default 0 disables
sort_by string no Ranking column, default short_interest_shares; missing evidence always last
sort_dir string no Sort direction, default desc

canary_data_health

Read Canary's authoritative provider/service health, receiving data modes, causes and producer clocks. Sources are services and data products, never individual instruments; quote availability and chart coverage stay in their dataset tools. A passive read performs no broker or provider acquisition. Follow next_offset with the returned revision for a consistent complete report. Unknown means unverified, never healthy. Use canary_data_check to request a bounded check, canary_status for service connectivity, and dataset tools for values.

Parameters:

Name Type Required Description
limit integer no Maximum sources per bounded page; default 24. Byte limits may return fewer.
offset integer no Zero-based page offset; default 0. Use the preceding next_offset.
revision string no Report revision from the first page; omit to begin a current report. Expired revisions require restarting pagination.

canary_data_check

Request or inspect a coalesced bounded check of required data sources using reference quote probes, not a holdings inventory. Counts describe sources, not instruments. Reuses Canary subscriptions and existing retry windows; history, options and public sources keep their producer schedules. Returns queued/running or completed coverage; it cannot purchase subscriptions or repair access. Use canary_data_health for the passive canonical report. Does not place orders, change settings or restart the gateway.

No parameters.

canary_portfolio

Read current portfolio composition in account base currency: signed market value by asset class and by GICS sector as a share of net liquidation. Options count at premium value under their underlying; the embedded index funds (SPY, QQQ, IWM) spread over published sector weights with their as-of dates; other funds pool without look-through. Holdings the broker no longer quotes or marks at zero are excluded and counted. Cost basis uses broker average cost including the option multiplier. This is allocation, not directional risk, a return percentage, or statement performance.

No parameters.

canary_recon_status

Read redacted automatic statement acquisition and capital-flow/equity reconciliation status. Acquisition health is separate from evaluation. This does not prove complete broker order or fill visibility and performs no refresh, reconciliation acknowledgement, or broker action.

No parameters.

canary_market

Read benchmark quotes and independent quotes for held underlyings, including option-only holdings. Preserves contract identity, current versus close prices, feed quality, source timestamps and partial coverage. Benchmarks name their actual instruments, including ETFs. With bond_identifier (an ISIN or CUSIP) it instead checks one bond or bill read-only: whether the broker resolves it to exactly one line, asked as BOND and, for a government bill's identifier, also as BILL (maturity, coupon, class bill or bond, min size, tick, assumed quantity unit) and one quote (bid/ask/last per 100 of face, yields in percent, fresh only for a live bid or ask); a gap is returned as resolved or quoted false with a reason, never as zero. Use canary_positions for valuation and Greeks; this is not a chart or order tool.

Parameters:

Name Type Required Description
bond_currency string no optional three-letter currency for bond_identifier; default: USD for a CUSIP, else the ISIN's issuer country (required for XS ISINs)
bond_identifier string no optional ISIN (12 characters) or CUSIP (9) of one bond or bill to resolve and quote read-only; omit for the market snapshot

canary_market_history

Read bounded observed underlying price bars for a chart. Intraday ranges include extended hours; longer ranges use daily regular-session bars. Missing or rejected history is unavailable, never an empty healthy chart. Use canary_market for current quotes and canary_technical for analysis. No option history, continuous futures roll series, or trading authority. Futures history belongs to the exact dated contract.

Parameters:

Name Type Required Description
contract object yes Exact underlying identity; specify symbol, sec_type (STK, IND, CASH, FUT), exchange and currency; preserve con_id when known.
range string yes Requested date range; 1D uses 5-minute bars, 5D 30-minute bars, longer ranges daily bars.

canary_market_tape

Compare rallies and reversals with daily SPX/SPY/QQQ prices, a fixed 11-share-line/10-company leader basket, company participation, relative volume and VIX. Daily open/high/low, when available, show range recovery but not the time of a turn. Set history=true to read permanent local records and one/three/five-session closing-price follow-ups without a broker request; original and latest versions retain capture times and reconstructed-history labels. Follow-ups are price comparisons, not achievable trading returns or validated forecasts. Normal mode uses completed sessions and also archives the measurements. Missing data stays explicit. ETF volume is not total-market volume or signed flow; put/call flow is absent. Use canary_market_history for a named instrument chart, canary_regime for current regime and canary_edge for past portfolio decisions. Read-only; no risk-policy or trading authority.

Parameters:

Name Type Required Description
before string no Only with history=true: exclusive YYYY-MM-DD session date. Use history.next_before to read earlier pages beyond the rolling 60-day view.
history boolean no Default false. Read the durable archive with first/latest captures and one/three/five-session price changes. No score or trading rule.
sessions integer no Number of completed US equity sessions to align; default 20, maximum 60 per page. Missing observations remain null.

canary_status

Read daemon, gateway, storage, and source health, plus execution visibility and MCP client activation guidance. Execution visibility remains unproven until a fill from TWS or another API client is observed; executions.action gives configuration guidance. After an MCPB upgrade and host relaunch, check mcp_client.activation_required; run its restart_command yourself in a terminal only when provided, then recheck. Different or unverified daemon build capabilities require the matching installation. This tool never restarts anything. Each register strategy appears under strategies with its stage and its month's row as the proposal engine last served it, or why none stands. Use for connectivity or degraded-input diagnosis; use canary_brief for the desk decision surface.

No parameters.

canary_trading_status

Read local broker-write readiness, pinned context, freeze state, and blockers. It only reports readiness and does not place, modify, or cancel orders.

No parameters.

canary_settings

Read platform settings and observed data quality. This tool cannot change settings or authorize a broker action.

No parameters.

canary_orders_open

Read-only current-context order lifecycle view: journaled open orders, each with the origin that placed it (agent, human-tty, human-paired-device, daemon-preauthorised or daemon-owner-queued), and under untracked the orders working at the broker that Canary never placed, such as hand orders in TWS, which carry no origin. Trust an empty untracked only when untracked_status is current. Use canary_orders_history for past orders. It does not place, modify, cancel, or transmit orders and is not a broker statement.

No parameters.

canary_orders_history

Read-only bounded local order-journal history for the current account and mode. It does not place orders and is not an IBKR Activity Statement.

Parameters:

Name Type Required Description
event_limit integer no maximum lifecycle events returned per grouped order row; default 20, max 200. When truncated, rows carry events_truncated and total_events_count.
limit integer no maximum grouped order rows to return; default 50, max 500
since string no optional inclusive lower boundary as YYYY-MM-DD UTC date or RFC3339 timestamp; default is 7 days before until
until string no optional upper boundary as RFC3339 timestamp, or YYYY-MM-DD UTC date to include that whole UTC day; default is now

canary_order_status

Read-only lifecycle and typed callback evidence for one locally journaled order. Broker free text is withheld; this tool cannot preview or change the order.

Parameters:

Name Type Required Description
id string yes order identifier to inspect: local order_ref such as canary-20260528-093000, IBKR order ID, or permanent ID. Orders journaled before the product was renamed carry an ibkr- prefix instead; pass those through unchanged

canary_account

Read account financials. The authority block identifies one concrete account and mode with availability, freshness, typed reason, and field presence; missing is never zero. Each currency_exposure row and the base_currency_ledger carry interest: the broker's own credit and debit rate on that currency's cash from the Flex statement's Interest Details (Tiers) section (source flex_interest_tiers, read_at), each side available with the annual decimal rate on the tier the current balance's top unit falls in, that tier, every tiers row, the broker's value_date and generated_at, or unavailable with the reason and last_value_date (no row for the side, no statement with the section, or a value date older than two business days); never zero for unknown.

No parameters.

canary_positions

Read held positions and exposure. The authority block identifies one concrete account and mode with availability, freshness, and typed reason; stale or unavailable empty rows do not prove an empty book. Held bonds and bills stay in stocks with their valuation (sec_type BILL or BOND); the bonds section classifies each by con_id as bill, bond or unresolved (with a reason) and adds maturity, days to maturity, coupon, ISIN/CUSIP and currency, and where it can be measured the issuer and issuer class, yield, modified duration and, in the account base, value, DV01 and rate_shock_loss_base (the loss if yields rise one point), else risk_unmeasured saying why. bond_risk sums them: bonds and the one-point loss as % of NLV, by currency and issuer, the non-government share, and the lines not in the sums. Each classified line's facts, in its own currency and per 100 of face, state the price it trades at (price with price_source bid or mark; bid, ask, mark, the prior close and the quote clock), its yield on a named yield_basis (simple actual/360 for EUR bills, actual/365 for USD, GBP and CAD bills, yield to maturity for coupon bonds; the broker's yield ticks are not used), the change since the prior close in basis points with that close's date, the value change for +25 and -25 bp and dv01 as a model estimate, face_value and pays_at_maturity, the purchase (date and price from Canary's order journal, else the broker's average cost without a date, source saying which) and pnl: the clean gain since purchase with carry, rates and spread that sum to total; the spread reads a BTF against the nearest Bubill benchmark and is spread_unavailable with the reason until a benchmark yield is on record. Every missing fact is absent with a *_unavailable reason, never zero. Measurement only: no bond limit judges these yet.

Parameters:

Name Type Required Description
symbol string no filter to a single underlying symbol (case-insensitive)
type string no filter to stock or option positions
view string no response shape: full returns existing stocks/options/by_underlying detail plus protection_coverage; risk returns compact portfolio aggregates, top exposures, option-health counts, protection coverage, and flagged option legs

canary_strategies

Read how Canary groups currently held option legs into proportional strategies and which legs still need review. The authority block is the positions read's: one concrete account and mode with availability, freshness, and typed reason. When availability is unavailable, an empty strategies list does not mean no strategies are held; report the reason, and treat strategies a stale read still lists as context, not current holdings. Use canary_positions for the full book. This tool cannot preview, submit, place, modify, cancel, or transmit an order.

No parameters.

canary_technical

Analyze explicitly named stock or ETF symbols using daily trend, relative strength, ATR, and liquidity evidence. This is analysis, not order entry.

Parameters:

Name Type Required Description
benchmark string no relative-strength benchmark, default SPY
currency string no optional ISO currency override for symbols, e.g. USD or EUR
exchange string no optional IBKR exchange override for symbols, e.g. SMART or IBIS
lookback_days integer no calendar-day history lookback; default 420, enough for 200-DMA and 126 trading-bar returns
market string no optional route for symbols, not the benchmark; omit/use us for SMART/USD, use de for Xetra/IBIS EUR equities, or uk for London equities (SMART, LSE, GBP by default)
primary_exchange string no optional primary-exchange hint for symbols, e.g. ARCA for ETFs or IBIS for Xetra
symbols array yes ticker symbols, e.g. ["AAPL","MSFT","NVDA"]

canary_calendar

Read official exchange sessions to plan work around market opens, closes, holidays, and early closes. Supports US cash equities, US listed options, Xetra, London SETS, Tokyo, and Hong Kong cash equities. Session windows exclude scheduled lunch breaks; outer open/close alone cannot establish tradability. Preserve timezone, source, coverage bounds, and session.state: unknown is not closed and cannot supply a trading schedule. This is an exchange-session calendar, not an economic-release or earnings calendar; use canary_brief for current held-name event context. Read-only; no scheduling, refresh, or broker actions.

Parameters:

Name Type Required Description
at string no optional RFC3339 instant including a timezone offset; evaluates the market at that instant and takes precedence over date
date string no optional YYYY-MM-DD in the market timezone; evaluates that date at local noon. Omit for now; at takes precedence when both are supplied
days integer no number of forward calendar dates including the selected date, not trading sessions; default 14, maximum 400
market string no exchange-session market; default us. US listed options models the regular 16:15 session; per-class exceptions and global/curb hours are not modeled

canary_macro

Read cached economic releases, central-bank meetings and recent official publications for the trading day. Includes BLS, BEA, Federal Reserve, New York Fed and ECB sources with per-feed availability, original times and a bounded window. Missing or stale feeds do not mean nothing is scheduled. Preserve source_label/date-only precision, per-source window bounds, failure streaks and list-specific events_truncated/publications_truncated flags; legacy truncated is their union. New York Fed supplies independent key-release backup; its success does not establish full BLS coverage. Use window_start/window_end to filter source-local calendar dates before response limits. This is official-source coverage, not a licensed general-news or consensus feed. Use canary_calendar for exchange hours and canary_brief for the current book and risk. Read-only; does not fetch, acknowledge, schedule or trade.

Parameters:

Name Type Required Description
window_end string no inclusive source-local YYYY-MM-DD; supply with window_start
window_start string no inclusive source-local YYYY-MM-DD; supply with window_end, at most 31 days; omitted window uses yesterday through next week

canary_regime

Read the detailed broad-market regime: all eight indicators, independent clusters, confirmation eligibility, gamma horizons and skew, source health, and stale or unavailable evidence. Choose view=monitor for a compact dashboard projection or view=full (default) for detailed evidence. Use after canary_brief or for an explicit market-regime question; use canary_stress for how that market state affects the held portfolio. Gamma is a conditional amplification/damping model; open interest does not identify dealer inventory or market direction. Read-only; no history or refresh controls.

Parameters:

Name Type Required Description
include_profiles boolean no Include large gamma profile arrays; false by default. Scalar measurements, thresholds, warnings and freshness are always retained.
view string no full (default) retains detailed evidence; monitor uses the shared compact dashboard projection. monitor cannot include gamma profile arrays.

canary_stress

Read the full current portfolio-stress assessment: margin, P&L and tape shocks, exposure, concentration, protection coverage, held-name and options risk, market indicators, and source health. Use after canary_brief or for an explicit portfolio-risk question; use canary_regime for the detailed broad-market dashboard. Preserves the same shared assessment used by the app. Missing inputs cannot become healthy zero values. Advisory and read-only; cannot preview or submit orders or change limits.

No parameters.

canary_mandate

Read the daemon's mandate risk verdict: the book's ex-ante volatility (historical simulation with full revaluation of every stock and option leg, currency moves included) against the owner's volatility budget, which is the mandate's target times the high-water mark of the risk base (equity after the tax reserve, cash-flow adjusted) times the room left under the maximum loss. verdict.status is within, over, reduce or unknown; verdict.reasons names every missing or stale input (the verdict is unknown, never within, without them); verdict.underlyings and verdict.legs carry Euler risk contributions that sum to 100%, betas to SPY and each name's gap loss against its gap cap; verdict.stresses the index shock and the gap breaches; evidence the clocks of the equity, positions and every daily series; gate.refuses_additions whether risk-adding stock and ETF orders are refused right now (mandate_budget on an order preview); gate.options the same for option buys, which the premium limits gate instead (owner decision 2026-10-23: mandate_premium refuses a buy that would take one name's premium at risk past option_name_act_pct of NLV or the book's past the premium budget's act level; gate.options.warning carries the volatility verdict an option buy passes with); gate.override the owner's active one-shot override of mandate.vol_target_pct with its reason and expiry, while one lifts the volatility gate; exposure the book through the greeks for the operator to watch, per underlying and in total: net delta in money, the same through each name's beta (delta_beta_base), gamma per 1% move, theta a day, vega a point, each name's share of the risk and beta, and the premium at risk against its cap (premium_cap_base, premium_room_base, premium_over), a figure that cannot be measured absent with its reason in unknown, never zero; reduction the forced reduction back to budget (its state: watching until a second scheduled verdict at least five minutes later confirms the breach, reducing, held while no fresh verdict of the book as held confirms the sizing, within once the standing rows were withdrawn), whether mandate_reduction is pre_authorised, how many rows are pending and the veto_until time, and its orders in dispatch order. register lists each machine strategy of the strategy register (the core first): its rule and whether the policy cites its lab spec, its stage as written and as this build runs it (shadow, live, suspended or hold), the part of its risk allocation it reserves, why it holds and the data its rule collects. verdict.owner_stop, present when [mandate.sleeves] owner_stop_pct is written, is the owner sleeve's own drawdown stop: the sleeve's fall from its high-water mark, whether the stop is engaged (the sleeve then adds nothing and the reduction cuts it to target_use_base, half its risk at the stop, pinned until the drawdown is back under release_pct, five points under the stop) and whether risk is still over that target. active is false while the constitution carries no [mandate] table. Use it for 'can I add risk', 'what is driving the risk' or 'why was my order refused with mandate_budget'; use canary_stress for the broader stress findings and canary_policy_check for the mandate keys and the realised figures. Read-only; it places no order and changes no limit; refresh=true reads the account and positions again first.

Parameters:

Name Type Required Description
refresh boolean no when true, the daemon reads the account and positions again before judging; false (the default) serves a verdict younger than thirty seconds as it is

canary_core

Read the daemon's core sleeve target: the mandate's rule-based share in one broad index fund (rule core-ibcf-v1, the fund IE00B3ZW0K18 in EUR; instrument is the contract IBKR lists under that ISIN, its primary exchange and the calendar it is judged on), a beta allocation the owner chose with a drawdown filter, not an edge claim. decision is the month's reading at the last session of the month on that calendar: the close against its 10-month average (trend_on), the EWMA, 252-day and floor volatilities and which one binds, frozen at its first evaluation (frozen_at; drift when the same window's closes later read differently). sizing is the target in shares and money, frozen at the decision and lowered to today's capital, and holdable the largest holding the mandate's headroom admits (the book at most at 95% of the budget and the core's gap at most at 95% of its cap). holding is that contract's confirmed shares; action is what the rule would do at the next window (buy, sell, sell_all, wait, none or hold) with its reason, the band test and the minimum order. stage is the core's entry in the strategy register: its stage as written and as this build runs it, and the part of its allocation it reserves; while the core runs in shadow, shadow is its paper position on the production code and its newest records (each month's decision, the intent for the next session with the order terms its row would carry, and its simulated fill at that session's close), research evidence that is never sent. While the core is live, row is its pending core_rebalance proposal (key, action, quantity, the session it is for, its state, blockers and readiness, and the terms: a DAY limit at the live mid for the first five sessions after the decision that the US also trades) and last_decision the last month decided live with what became of its row (served, sent with the order reference, or the latest refusal). The owner can confirm each row through the prepared-proposal path, or an authorized controller can submit it under the device-confirmed standing mandate; buys require Fully armed scope and all daemon gates are re-checked. Installing this release does not arm the controller. Reading this tool never submits an order. status is ready, hold (with reasons: an unresolved or ambiguous contract, a missing, stale or refused series read, unwritten keys, an unknown mandate verdict) or inactive while the constitution carries no [mandate.core]. Use it for 'what is the core doing', 'why did the core not buy', 'is a core row pending' or 'what will the core trade at month-end'; use canary_mandate for the whole book's risk budget and canary_proposals for orders waiting for approval. Reading changes nothing: read_only is true while the core is not live; refresh=true measures the mandate again first.

Parameters:

Name Type Required Description
refresh boolean no when true, the daemon reads the account and positions and measures the mandate again before deciding; false (the default) uses a mandate verdict younger than thirty seconds

canary_strategy

Read the daemon's target for one machine strategy of the strategy register by its id (id: "core" for the core sleeve, else the [mandate.strategies.<id>] table's key; canary_mandate lists them). It is the same verdict shape as canary_core for any entry: rule (the compiled rule, timed-holding-v1 for an entry the owner parameterises), signal (the trend filter from the library, trend-sma10m), spec_hash (the lab spec the entry cites), sleeve, instrument (the fund by ISIN and currency as IBKR lists it), decision (with signal_from and traded_close while the month is measured on the fund's older share class because the traded line's own closes do not fill the window; evidence.signal shows that series and when the line's own closes take over), sizing against the sleeve's risk allocation, holding (the units its own fills left on its line; your units of the line hold it, named, and a hand buy of a live entry's line is refused), action, stage and kill (the kill rule's drawdown in units of the sleeve's capital at its stage (scale_pct: its allocation over the 15% floor, times the scale), on its own fills while live (source: own_fills) or on the shadow record, against kill_drawdown_k; past it the strategy holds and the owner suspends it; a live entry without a written bound holds). While the entry is live (read_only=false), row is its pending month's row (a strategy_rebalance proposal, or core_rebalance for the core: key, action, quantity, the session it is for, its state, blockers and readiness, and the terms: a DAY limit at the live mid for the first five sessions after the decision that the US also trades, due fifteen minutes after the US cash open) and last_decision the last month decided live with what became of its row. The row is sent only on the owner's device confirmation through the gated proposal path or by an authorized controller under the device-confirmed standing mandate (buys require Fully armed scope and the register the mandate was armed under); Canary's gates re-check it at every point it passes. Installing this release does not arm the controller. status is ready, hold (with reasons: an unwritten key, a filter the library lacks, a currency other than the account's base, an unresolved contract, a missing or stale series, an unknown mandate verdict, units of its line it did not buy, the kill bound) or inactive. Not the option combos of canary_strategies. Reading this tool never submits an order. refresh=true measures the mandate again first.

Parameters:

Name Type Required Description
id string yes the strategy's id in the register: core, or the [mandate.strategies.] table's key
refresh boolean no when true, the daemon reads the account and positions and measures the mandate again before deciding; false (the default) uses a mandate verdict younger than thirty seconds

canary_brief

Start here for the daemon's current desk summary: regime stage and verdict, portfolio-stress summary, breadth coverage, modeled gamma response and expiry horizons, and observed 25-delta option skew. Preserve freshness, rankability, source warnings and unavailable values. Take severity order from Canary: attention_order lists what needs attention (drawdown tier, latch, rules at act, then other attention rows) and ready.ranked orders every Ready row; never re-sort them. Gamma models potential amplification or damping; open interest does not prove bullish/bearish intent or dealer inventory, and put-call skew is relative option pricing, not a forecast. Use canary_regime for all market indicators and confirmation details, canary_stress for full portfolio-risk evidence, canary_status to diagnose degraded sources and canary_edge for retrospective decision outcomes; drill into canary_positions or canary_account only when the brief points there. Read-only; never acknowledges the brief or writes to the journal.

No parameters.

canary_reporting

Read shared IBKR statement-reporting setup, broker reachability, backfill state, absent sections, present-empty sections, and proven missing fields for Recon and Edge. Read-only; returns no Query ID or token and cannot validate candidates, refresh reports, or change setup.

No parameters.

canary_reporting_fx

Read completed daily FX valuation contribution for investments, currency cash and native accrued interest, in the portfolio base currency. Use for the effect of exchange rates over Day, week-to-date, month-to-date and YTD. Returns ascending daily contributions, reconciled period totals, explicit missing dates and acquisition progress. Null/absent money is unavailable evidence, never zero; no_exposure means no gross foreign exposure throughout a complete period. Uses closing native values, including price/income interaction and actual conversion principal correction. Does not report asset performance, realised currency tax lots or live intraday P&L. Use canary_reporting_performance for portfolio performance facts and canary_account for live P&L. Read-only cached evidence: cannot start backfill, alter configuration or transmit orders.

No parameters.

canary_reporting_performance

Read the retained IBKR statement equity series in the account base currency (one close per report date), dated external capital flows (deposits, withdrawals, position transfers in and out), statement coverage, and year-to-date sums of FIFO realised trading P&L, commissions, dividends, interest, withholding tax and fees, so that a consumer can compute cash-flow-adjusted (time-weighted) performance, drawdowns and a benchmark comparison itself. A missing report date is a gap, never interpolated; nothing is annualised or compared here. Use canary_account for live net liquidation and today's P&L, canary_reporting for statement setup and broker reachability, and canary_recon_status for capital-flow reconciliation verdicts. Read-only; returns no account identity, computes no return figure, and cannot refresh statements.

No parameters.

canary_reporting_costs

Read the half-spread each fill paid against the exact-contract quote Canary retained at the fill: per fill the side, quantity, price, bid, ask and mid, the quote's age against the fill, and the cost in the contract currency and in the base currency at the fill's own FX rate; totals by month, by source (orders Canary placed versus executions observed from the account) and by instrument class; coverage as fills with a usable two-sided quote over all fills; fills without a live quote listed as unknown with the reason. Each fill names its retained base currency; totals keep different base currencies separate. Delayed, frozen and unclassified feeds remain visible but are not measured costs. Requires one concrete account scope. Use for execution quality and spread cost. Not for realised P&L (canary_reporting_performance), statement setup (canary_reporting) or order state (canary_orders_history). Executions entered in TWS or by other API clients appear only when TWS reports them to this client; the observation section says whether that is proven and names the TWS Master API client ID setting, which the owner decides. Read-only: names no account, computes nothing live and cannot place or change orders.

Parameters:

Name Type Required Description
month string no optional calendar month YYYY-MM in UTC; omitted returns every retained fill

canary_edge

Call with no arguments after canary_brief for an automatic one-year review of historical decision price outcomes: action/direction coverage, comparisons of the same decisions at different horizons, monthly consistency, concentration, and exact local protection provenance when available. SPY, QQQ, DIA, and VIX supply informational context. Options separately report option lifecycle coverage, proven flat-to-flat exact-contract positions, broker-reported realized option episodes, and the latest dated open option snapshot; these scopes overlap and must not be added. Use a returned change_id or returned option_id for broker-fact details; completed position cycles are already expanded in options.cycles, each with closed_by (trade, expiry, exercise or assignment; after an exercise or assignment the P/L is the option leg's only). The option lists return 20 rows by default; their counts and known totals always cover every row, and option_offset with option_limit pages them, following next_offset until it is absent. Do not use for current risk, order decisions, forecasting, or causal claims. Do not infer skill, strategy win rates, trade intent, or risk effectiveness. Use canary_brief for current portfolio risk and canary_positions for current holdings. Read-only; parameters select retained evidence and cannot refresh data.

Parameters:

Name Type Required Description
change_id string no optional opaque change ID returned by a prior canary_edge call
horizon_sessions integer no optional explicit decision-price-impact horizon; omitted selects the longest adequately covered horizon automatically
limit integer no maximum findings; default 3
option_id string no optional opaque option ID returned by a prior canary_edge call
option_limit integer no rows per option list; default 20. Counts and known totals cover every row whatever the page.
option_offset integer no first row of each option list (options.cycles, options.realized, options.open) to return; default 0. Pass a list's next_offset to read its next page.
window string no optional review override; default 365d

canary_scorecard

Read the daemon's decision scorecard: one ledger row per past position change (open, add, trim, exit) per sleeve, each scored at 5, 10 and 21 sessions after entry as the underlying's move net of the market and its sector fund in units of its own pre-decision noise (z), plus, for options, the realised-vs-implied move and the option's P&L against the delta-equivalent stock position, and the half-spread paid at the fill from the quote retained there (slippage; fills before 2026-10-18 have none). Per sleeve and stream it carries the sequential evidence on the directional score (the mean z per name-week unit; not an information coefficient): entries (open, add) are gated (established, futile or accruing) with every component disclosed, the effective sample after overlapping horizons, the e-value, the posterior P(score > 0, 0.05, 0.10), the futility e-value and the sign-shuffle placebo; exits (trim, exit) report the same statistics and are never gated; decisions on a broad index underlying (SPY, SPX, SPXW, XSP, QQQ, NDX, IWM, RUT, DIA, or a pre-entry R² on SPY of at least 0.9) are market timing and hedges, scored as the index's own move over its total pre-entry volatility in index_entries and index_exits, reported and never gated, with the realised-vs-implied median of bought puts; one name in one entry week counts once; fills Canary's own rules or the broker's lifecycle produced are the rule sleeve and count for no owner stream. Use for the question whether a strategy's decisions carry information, how far the evidence is from a decision, and what the fills cost in spread; quote figures with their sample and never call a sleeve skilled before its gate reads established. Not for price consequences in money (use canary_edge), the monthly cost report (canary_reporting_costs), current risk (canary_stress) or holdings (canary_positions). Unknown scores stay unknown with a reason. Read-only; the daemon evaluates, the read cannot refresh history.

Parameters:

Name Type Required Description
limit integer no decisions to return, newest first; default 50. The sleeve evidence always covers every decision.
sleeve string no optional sleeve name, lower case, for example owner; omitted returns every sleeve

canary_lending_market

Compare prices and liquidity for 1-100 named USD stocks with exact identities from the US borrowing feed or previously resolved displayed research rows. Returns cached market context and queues bounded background acquisition, one stock at a time: last completed close or recent trade with feed/date, day change, session shares, 20-completed-session average dollar turnover and YTD completed-close price return excluding dividends. Exact contract identity is required; named reads do not initiate missing-feed resolution. Missing history stays absent; pending rows fill on later reads. Five-minute context receipts; no synchronous per-symbol scan. Use canary_lending_screen to discover names, canary_lending_rates for fees, and canary_market_history for charts. Filters over these values are research, not liquidity guarantees, orders or lending enrollment. Read-only.

Parameters:

Name Type Required Description
symbols array yes Explicit US borrowing-feed stock symbols, normalized and deduplicated

canary_lending_screen

Discover unusually expensive borrowing outside known holdings or a watchlist, ranked by annualized borrower fee in IBKR's US short-stock bulk feed. Applies price, turnover, distinct source-date filters and sorting across fee/exclusion candidates before limiting output. One fair bounded worker prioritizes at most 100 returned rows in display order, taking a dated completed-close price read before yearly enrichment, while preserving background progress; reads do not fan out broker requests. Returns market evidence and covered/pending/unavailable counts across the candidate universe. Incomplete coverage is not zero matches. High dates are distinct provider dates within seven days, reset by later lower rates; repeated polls never add dates. Returns bounded rows, company names, source clocks, source health, total/usable/matching counts and truncation. Unavailable source is distinct from no matches. This is not all markets, lender yield, verified listing or liquidity, allocation, earned income or a buy recommendation. Use canary_lending_rates for named symbols and canary_lending_fees for earned income. Read-only; no orders, enrollment or risk-policy changes.

Parameters:

Name Type Required Description
exclude array no Known symbols to omit, normalized case-insensitively; optional
limit integer no Maximum ranked results, default 25; matching count reports omitted results
min_avg_dollar_volume_20d number no Minimum known average USD turnover across 20 complete sessions; default 0 disables.
min_high_dates integer no Minimum distinct provider dates at min_rate within seven days, reset by a later below-threshold observation; default 0 disables.
min_price number no Minimum known USD price; default 0 disables. Applied across candidates before limit; missing evidence excluded.
min_rate number no Minimum annualized borrower percentage, default 50; research filter only
sort_by string no Field ranked before limiting results; default fee_rate. Missing values stay last.
sort_dir string no Sort direction, default desc; symbol breaks numeric ties.

canary_lending_rates

Read dated indicative annualized borrowing fees for 1-100 explicit US stock symbols using Canary's existing market-event source and cache cadence. Returns symbol-level borrow_fee_coverage, nullable fee_rate, source dates, scale_status, policy_eligible and source_health. Missing, stale and unverified-scale rows are not zero or usable quotes. These are borrower rates, not the owner's lending yield, guaranteed allocation, exact contract identity, earned income or buy recommendations. Use canary_lending_fees for actual reported income. Read-only; no enrollment, policy changes or orders.

Parameters:

Name Type Required Description
symbols array yes Explicit US stock symbols; case-insensitive, deduplicated and sorted

canary_lending_fees

Read earned customer net stock-lending fees, native/base currency sums, report coverage and a bounded latest-first history. Use after canary_edge to expand lending income or to read historical fees after a holding closes. Missing sections, net amounts or conversion stay unavailable; fees are not extra P/L to add to broker equity and collateral is not income. Cash-payment and P/L reconciliation are unproved until linked statement evidence exists. Use canary_positions for dated loan annotations and current holdings, canary_edge for decision review, not this tool for short-borrow availability or enrollment. Read-only retained evidence; cannot fetch Flex, enroll or place orders.

Parameters:

Name Type Required Description
con_id integer no optional exact stock contract ID; omitted or zero includes all contracts
cursor string no opaque next_cursor returned by the prior page; bound to period, scope and contract filter
fingerprint string no optional summary fingerprint from Edge or a prior page; rejects changed evidence
from string no optional exclusive opening YYYY-MM-DD equity date; requires to
limit integer no maximum fee rows per page; default 25; totals always cover the full period
to string no optional inclusive closing YYYY-MM-DD equity date; requires from; at most 400 days
window string no Edge period; default 365d unless paired explicit equity dates are supplied

canary_rules

Read the desk Rulebook: each rule's verdict against the owner's limits (worst-case loss on one issuer with every leg netted, premium per option position, the premium budget, time value, expiry, earnings, loss per option, currency and net market exposure, three concentration watches that never act, and margin headroom as the worse of current and look-ahead excess liquidity), ranked hardest first, with explicit unknown inputs. sell_only is active while the premium budget or net exposure is at watch or act and names those rules. policy_status says where the limits came from (Canary's defaults, flagged review: unreviewed until the owner reviews the file, or the owner's rulebook-policy.toml) and policy carries every threshold, so this answers 'am I within my limits' and 'how much room is left'. Each row's threshold is the limit for its status (the act band at act, otherwise the watch band) and its evidence quotes that number; two-band rules also carry watch_threshold and act_threshold, and each offender its own status. A rule 1 offender carries issuer: its lines, legs, worst-case loss, credited and uncredited hedges and unbounded legs. Use canary_proposals for protection orders and canary_brief for the capital and drawdown ladder. Read-only: the owner changes limits with canary rules policy set. Advisory evidence never authorizes an order.

Parameters:

Name Type Required Description
symbol string no optional underlying symbol (case-insensitive) to narrow per-rule offender lists; an issuer group holding the symbol is kept; portfolio verdicts are unaffected

canary_policy_check

Read the plausibility check of the owner's config.toml and policy files: values read against each other, across files and against the live book. Use it for 'do my limits make sense', 'why is a ready proposal refused at the trading gate' or before suggesting a policy edit. Each finding carries severity (error: an order path that can never work or a contradiction, such as a bucket's max_order_notional above the order cap in force of the risk constitution's [order_limits], a missing [order_limits] key, or a watch level above its act level; warn: implausible against the book or the economics, such as a per-order cap under 2% or over 50% of NLV, a cash reserve under 2% of NLV, or a sweep minimum whose interest does not cover the commission; info: unreviewed defaults and dates about to end), keys (file, key, value), a one-sentence message and a suggestion with its reasoning. skipped names the checks that did not run (no live account, no positions); assumptions names every number assumed because no key carries it. Use canary_rules for the verdicts against those limits. Read-only: it never changes a limit; the owner edits the files.

No parameters.

canary_proposals

Read-only proposals: protection candidates for existing positions and, when enabled, cash sweep and currency leveling rows. Protection candidates are stops, option loss exits and profit trails, closes of in-the-money long options near expiry (option_expiry_close), and premium-budget reductions; while the risk constitution carries [mandate], mandate_reduction rows cut the book back to its risk budget (a reduce verdict, or two consecutive over verdicts), largest risk contributor first, each with a mandate block (rank, batch_rows, phase expiry/gap/risk, contribution_pct, units of the whole cut, the verdict it was sized on, its breach episode, held with hold_reason while no fresh verdict confirms it) and the snapshot's mandate_reduction status, whose plan lists every cut with this cycle's quantity and, where the order caps hold it lower, why it waits. The batch is sized afresh at every verdict; it never buys back a short option, never sells the shares that cover one (a covered position needs the owner's hand, and the status names it), never cuts shares below what the long options on them deliver at exercise, and never sells protection. Pre-authorised rows carry automatic, shadow and never_skip_veto; governor rows carry a budget block whose basis is declared_risk_capital or rulebook (the Rulebook's premium budget and per-position limit). The budget_reduction status lists up to three candidates (ranked by open Rulebook rules relieved, then time value, then unrealised loss, each with a one-line why) and the whole plan (every order, with the cycle it can go in when max_order_notional holds it back); under basis rulebook, rulebook_review (reviewed, unreviewed, no_file, drift or error) names the review state of the Rulebook limits; it is advisory, and the configured mode alone decides shadow. A blocked option exit names why: option_quote_broker_unavailable or option_quote_request_failed when no quote could be read, otherwise the unmet quote, session or evidence requirement. When several buckets would sell the same exact contract, one row carries every reason under covers; the rows it stands for are blocked covered_by_proposal and name it in covered_by, while a pre-authorised row Canary still places stays live and is listed with automatic: true. A row carrying queued is covered by the owner's queued authorisation for the open (Canary sends it itself inside its window): it is neither a candidate nor ready to act, and counts.queued counts such rows. It can refresh discovery but cannot preview, submit, place, modify, cancel, or transmit an order. Not for option exercise: use canary_opportunities. When the owner enabled the cash sweep, cash_sweep reports per currency the cash (the lower of trade-date cash and broker-observed per-currency settled cash, named in settled_cash_source; without that observation it holds at settlement_unknown, and the order journal's estimate cannot authorise a sweep), commitments, free cash above keep_cash, cash equivalents, cash_like (cash plus equivalents when both are known) and a state (invest, redeem, hold, no_instrument, an unknown posture such as settlement_unknown or needs_your_number, or universe_unavailable / instrument_unresolved when no bill could be named, with evidence); tax_reviewed false is advisory only. Each invest row's cash_interest is the broker's credit rate its benefit estimate forgoes, read from the Flex statement's Interest Details (Tiers) section (available with the annual decimal rate, tier and value_date, or unavailable with the reason, when the estimate reads unavailable); it is never an entered or assumed number. Its rows (bucket cash_sweep, each with a cash_sweep block) buy or sell same-currency bills as limit DAY orders of the bill's own security type (BILL for a US bill, BILL or BOND for the others) and never convert: an invest row names its resolved bill (ISIN or CUSIP, maturity, quoted price per 100 of face, min_size, size_increment, min_tick), its quantity in the bill's order unit (quantity_unit face_1000 or face_1), face_value and estimated_cost; a redemption sells a held bill in the position's unit; each row names the session its order fills in. A row is blocked only by what stops the order: fresh_bill_quote_required (stale quote or mark), bill_contract_rules_unavailable or below_minimum_increment (a redemption the bill's size grid cannot fit), bill_unit_mismatch (a preview's broker WhatIf initial-margin change divided by the order's value at the assumed unit fell outside 0.005 to 1.2; buys of that bill instrument wait until a preview checks clean); a shadow row carries shadow_mode. Active rows are ordinary proposals the owner previews and approves (or pre-authorises with cash_sweep), always after the full veto window. When the owner enabled currency leveling, currency_leveling reports per currency the trade-date cash, its value in base, its role (loan or payer), the loan_rate or cash_rate measured from the broker's daily statements, and a state (convert, pays, in_band, deliberate_carry, hold with a reason, or cash_unavailable), with trigger_base, cushion_base, max_slippage_bp, payback_days, the order cap in force, rates_through and its bundles (one per loan: the row keys in send order, a revision, saving_base and cost_base); its rows (bucket currency_leveling, each with a currency_leveling block naming the borrowed currency, the paying funding_currency, the IDEALPRO pair, cash, target, allotment, received, spent, both rates, bundle_id, leg and legs) repay a currency whose cash is negative beyond the band, back between zero and the cushion and never more, from currencies whose cash earns less than the loan costs, as CASH limit DAY orders on the pairs' exact contracts that the owner approves per repayment; leveling is never pre-authorised, and its preview refuses conversion_beyond_target, conversion_funding_short, conversion_terms_drift, conversion_already_working, conversion_bundle_needs_one_approval or fx_spread_beyond_bound.

Parameters:

Name Type Required Description
refresh boolean no when true, ask the daemon to recompute proposals before returning; otherwise returns the latest daemon snapshot
show boolean no when true, records a shown audit event for returned proposal rows

canary_opportunities

Read-only option-exercise candidates for existing positions. It can refresh discovery but cannot preview, exercise, submit, or expose an execution token.

Parameters:

Name Type Required Description
refresh boolean no when true, ask the daemon to recompute opportunities before returning; otherwise returns the latest daemon snapshot
show boolean no when true, records a shown audit event for returned opportunity rows