Public.com MCP Server
OfficialAn MCP server that connects AI assistants to a Public.com brokerage account for market data, portfolio/order management, and trading.
Verify API credentials and list accounts, portfolio positions, equity, buying power, and open orders.
Query order status/history, fills, transaction history, tax lots, and tax-lot CSV exports.
Get real-time quotes and OHLCV price history for equities, crypto, options, indices, bonds, and event contracts.
Browse instruments, bonds, option expirations/chains/Greeks, and multi-leg strategy quotes.
Explore prediction/event markets, event details, contract price bars, current recurring windows, and settlement outcomes.
Preflight single-leg, multi-leg, short-sale, spread, and event-contract orders for estimated costs and impact.
Place single-leg, multi-leg, spread, short-sale, bracket, and event-contract orders; cancel, replace, or flatten-and-go-short.
Enforce server-side order safety: configurable quantity/value limits, mandatory preflight, optional user confirmation, and read-only mode.
Run locally over stdio or remotely over streamable HTTP with bearer-token authentication.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Public.com MCP Server show me my portfolio holdings"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Public.com MCP Server
An MCP (Model Context Protocol) server that connects AI assistants to your Public.com brokerage account. Trade stocks, options, and crypto — get quotes, manage orders, and view your portfolio — all through natural language.
Disclaimer: For illustrative and informational purposes only. Not investment advice or recommendations. Use at your own risk.
Tools
Read-Only
Tool | Description |
| Verify API credentials and connectivity |
| List all brokerage accounts |
| View positions, equity, buying power (including |
| List active/open orders (bracket legs share a |
| Status and details of a specific order, including its fills ( |
| Search order history — any status, last 30 days, up to 500 orders, filtered by status/side/symbols/type/time |
| Transaction history (trades, deposits, dividends, etc.) |
| Real-time quotes for stocks, crypto, options, event contracts |
| OHLCV price history for equities, crypto, options, indices, or event contracts |
| Details about a specific tradeable instrument |
| List all available instruments with filters |
| Filtered, paged search for fixed income instruments |
| Pricing, ratings, coupon and maturity info for a bond |
| Available expiration dates for options |
| Full option chain (calls + puts) for a symbol |
| Greeks (delta, gamma, theta, vega, rho, IV) for multiple options |
| Greeks for a single option symbol |
| Unrealized tax-lot summary (per-lot gain/loss, term, cost basis) |
| Unrealized tax-lot detail for a single symbol |
| Export unrealized tax lots as a Base64-encoded CSV file |
| Consolidated quote for a multi-leg option strategy |
| Event-contract (prediction market) categories, subcategories and frequency filters |
| Browse event contracts by category / symbol / frequency / resolution time, 100 per page |
| One event's outcomes (with |
| Price-history bars for up to 8 contracts of one event |
| The window of a recurring market (e.g. 15-minute |
| Wait (bounded) for an event outcome to settle and report the winning contract |
| Estimate costs/impact before placing a single-leg order |
| Estimate costs for multi-leg options strategies |
| Estimate costs before placing a short-sale order |
| Estimate costs for a Bear Call Spread |
| Estimate costs for a Bull Call Spread |
| Estimate costs for a Bull Put Spread |
| Estimate costs for a Bear Put Spread |
| Estimate costs before buying an event contract (YES or NO side) |
Write (Destructive)
Tool | Description |
| Place a single-leg order (stocks, crypto, options), including market-on-close / limit-on-close; optionally a bracket order via |
| Place multi-leg orders (spreads, straddles, etc.) |
| Place a Bear Call Spread |
| Place a Bull Call Spread |
| Place a Bull Put Spread |
| Place a Bear Put Spread |
| Place an equity short-sale order |
| Buy an event contract (YES or NO side) with a DAY limit order, at the ask by default |
| Sell an existing long position then go short (experimental) |
| Cancel an existing order |
| Atomically cancel and replace an order |
Every tool above except cancel_order runs the order through the order gate before anything is sent.
Order safety
The server, not the model, decides whether an order goes out. Every order tool (all the write tools except cancel_order) does this before it sends anything:
Limits. It refuses an order that breaks a limit the operator set in the environment (see below). The model can't change these settings from the chat.
Preflight. It preflights the exact order it is about to submit, using the same request it would send. If the preflight fails, the order is not sent.
cancel_and_replace_orderlooks up the original order to preflight the replacement, and a bracket order's preflight covers only its entry order.flatten_and_go_shortpreflights each of its two orders just before it is sent. First it preflights the flatten (a MARKET sell of the whole long position). Then, once the flatten has filled, it preflights the short and checks it against the limits. If the short fails that check, it is not placed: the account is left flat and the tool returnsflattened_not_shorted. The value limit never applies to the flatten, because it only closes a position.Confirmation. If the client supports MCP elicitation, the server shows the user the order and its preflight estimate and asks them to confirm. Only the user can answer this prompt; the model can't. If the user declines or dismisses it, the order is not sent.
When the server refuses an order, the tool returns "submitted": false with a status explaining why: blocked_by_limit, preflight_failed, not_confirmed, confirmation_unavailable, confirmation_failed or configuration_error. flatten_and_go_short can also stop after sending the flatten but before the short. It then returns the flatten's order ID with status flatten_not_filled, flatten_incomplete or flattened_not_shorted. When an order is sent, the response includes the preflight estimate and how the order was confirmation-ed (user_confirmed, client_tool_approval or disabled).
Variable | Default | Effect |
|
|
|
| unset | Refuses an order for more shares or contracts than this. For a multi-leg order, the count is the quantity times the largest leg ratio. |
| unset | Refuses an order if the preflight's order value, estimated cost or buying power requirement is more than this many dollars. The buying power requirement is what limits a sell-to-open option or a short sale, where the order value is only the premium or proceeds received. |
| unset | Set to |
If a limit is set to a value the server can't parse, every order is refused until it is fixed, so a typo can never quietly turn a limit off. The order gate adds to the client's own tool-approval prompt; it does not replace it. Keep that prompt on for order tools, especially when the model is reading untrusted content such as web pages or news.
Order types
place_order, preflight_order, cancel_and_replace_order and the short-sale tools
take order_type as one of:
| Price arguments |
| none |
|
|
|
|
|
|
| none — executes at the closing auction |
|
|
place_order, preflight_order and the short-sale tools also reject a price argument
the order type doesn't take (e.g. limit_price on MARKET_ON_CLOSE). Bracket entries
are LIMIT or MARKET only, and multi-leg orders are always LIMIT.
Bracket orders
place_order places a bracket by setting order_class to BRACKET, OCO or OTO
and supplying at least one exit leg:
Argument | Meaning |
|
|
| Limit price of the take-profit leg |
| Stop price of the stop-loss leg |
| Optional — makes the stop-loss a |
The exit legs are submitted automatically when the entry order fills, and every leg
of the bracket — the entry included — reports the entry's order ID as its
bracketId, so get_orders groups them.
The API accepts brackets for EQUITY and OPTION only; they need a whole-share
quantity (not amount), must use the CORE market session, and the entry
order_type must be LIMIT or MARKET (LIMIT only for OCO). preflight_order
validates the entry order only — it has no view of the exit legs.
Order history
get_orders lists only the open/active orders in the portfolio snapshot. For everything
else use the order-history tools:
Tool | Returns |
| Orders in any status (filled, cancelled, rejected, …) matching optional |
| One order by ID in the same shape |
Both are limited by the API to orders created within the last 30 days, and
search_orders returns at most 500 orders. Each order includes trades (the
individual fills, each with the marketIdentificationCode — the ISO 10383 MIC of the
execution venue, e.g. XNAS — when reported), filledAt, replacedAt, lastModified
and equityMarketSession.
Note that equityMarketSession uses REGULAR / REST_OF_DAY / TWENTY_FOUR_HOURS,
which is not the CORE / EXTENDED / TWENTY_FOUR_HOURS vocabulary that
place_order's equity_market_session argument takes.
Event contracts
Browse event contracts (prediction markets) with get_event_categories →
get_event_summary (page with next_token) → get_event_details, and chart with
get_event_contract_bars. Prices are dollars from 0.00 to 1.00 and equal the implied
probability. EventSummary.symbols lists related instruments (e.g. BTC-CRYPTO), not
the event's contracts — those come from get_event_details. Outcome ids carry no
exchange prefix (e.g. KXBALANCESHEET-EO26-6.6).
Trading recurring markets
For a recurring market such as the 15-minute "Up or Down" windows:
get_current_event(series="KXBTC15M")— the window open right now (seriesis the series ticker, shown on everyget_event_summary/get_event_detailsresult). Passwait_seconds(≤ 120) to wait between windows.get_event_details(event_symbol)— the YES/NO contracts, their asks, and whether the outcome istradableand how manysecondsLeft.preflight_buy_event_contract→buy_event_contract(contract_symbol, quantity, limit_price)— a DAY limit buy. Omitlimit_priceand passevent_symbolto buy at the current ask, rounded up to a whole cent. Quantities take at most 2 decimals.wait_for_settlement(event_symbol, contract_symbol=...)— waits up to 120 s per call and reportswinnerandwon; on timeout it returns"status": "pending", so call again.
The two halves take different identifiers, and the API rejects the wrong one:
Tools | Event identifier | Contract symbol |
|
| e.g. |
|
|
|
EVENTCONTRACT is also accepted as an instrument type by get_quotes,
get_price_history, get_instrument, get_all_instruments and search_orders.
Related MCP server: Alpaca MCP Server
Prerequisites
Python 3.10+
Public.com account — Sign up
Public.com API key — Get one here
Installation
pip install publicdotcom-mcp-serverOr install from source:
git clone https://github.com/publicdotcom/publicdotcom-mcp-server.git
cd publicdotcom-mcp-server
pip install .Configuration
Set your API credentials as environment variables:
# Required
export PUBLIC_COM_SECRET=your_api_secret_key
# Optional — sets a default account so you don't need to specify it each time
export PUBLIC_COM_ACCOUNT_ID=your_account_id
# Optional — order safety limits (see "Order safety" above)
export PUBLIC_COM_MAX_ORDER_QUANTITY=100
export PUBLIC_COM_MAX_ORDER_VALUE=5000
export PUBLIC_COM_ORDER_CONFIRMATION=auto # auto | required | off
# export PUBLIC_COM_READ_ONLY=true # disable all order toolsUsage
Claude Desktop
Add this to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"public-com": {
"command": "publicdotcom-mcp-server",
"env": {
"PUBLIC_COM_SECRET": "your_api_secret_key",
"PUBLIC_COM_ACCOUNT_ID": "your_account_id"
}
}
}
}Claude Desktop (using uvx)
If you prefer using uvx (no pre-install needed):
{
"mcpServers": {
"public-com": {
"command": "uvx",
"args": ["publicdotcom-mcp-server"],
"env": {
"PUBLIC_COM_SECRET": "your_api_secret_key",
"PUBLIC_COM_ACCOUNT_ID": "your_account_id"
}
}
}
}Running Directly
# stdio transport (default — for Claude Desktop, Claude Code, etc.)
publicdotcom-mcp-server
# Or run as a Python module
python -m publicdotcom_mcp_serverHosted / Remote Deployment
For remote deployments (behind a reverse proxy or load balancer), switch to the streamable-HTTP transport:
export MCP_TRANSPORT=streamable-http
export PUBLIC_COM_SECRET=your_api_secret_key
export PORT=8000 # optional, defaults to 8000
export HOST=0.0.0.0 # optional, defaults to 0.0.0.0
publicdotcom-mcp-serverIn this mode the server listens for MCP requests at POST /mcp. Clients authenticate per-request via an Authorization: Bearer <key> header, which takes priority over the PUBLIC_COM_SECRET environment variable — useful for multi-tenant deployments.
Testing with MCP Inspector
npx @modelcontextprotocol/inspector publicdotcom-mcp-serverDevelopment
# Clone and install in development mode
git clone https://github.com/publicdotcom/publicdotcom-mcp-server.git
cd publicdotcom-mcp-server
pip install -e ".[dev]"
# Run tests
pytest
# Run the server locally
python -m publicdotcom_mcp_serverCI & Releases
CI (
.github/workflows/ci.yml) runs the test suite (Python 3.10–3.13) andruffon every push tomainand every pull request.Releases (
.github/workflows/release.yml) run on every push tomain. When theversioninpyproject.tomlis one that hasn't been released yet (no matchingv<version>tag), the workflow builds the package, publishes to PyPI via Trusted Publishing (OIDC) — no API token is stored — and creates the corresponding GitHub Release. Merges that don't change the version are no-ops.
To cut a release: bump version in pyproject.toml in your PR and merge it to main. The release + PyPI publish + v<version> tag/GitHub Release happen automatically. One-time setup on PyPI (project → Publishing) must register a Trusted Publisher for this repo with workflow release.yml and environment pypi.
How It Works
This server wraps the publicdotcom-py Python SDK, exposing each API operation as an MCP tool. The MCP protocol allows AI clients to discover and call these tools through a standardized interface.
AI Client (Claude, etc.)
↕ MCP Protocol (stdio)
Public.com MCP Server
↕ HTTPS
Public.com Trading APIAll tools include proper MCP tool annotations:
Read-only tools are marked with
readOnlyHint: trueOrder-placement tools are marked with
readOnlyHint: false(they modify account state)Order cancellation tools (
cancel_order,cancel_and_replace_order) are additionally marked withdestructiveHint: true
License
Available Tools
46 toolsbuy_event_contractA
Buy an event contract (a YES or NO side of a prediction market) with a DAY limit order.
⚠️ This executes a real trade. Before submitting, the server preflights this exact order and refuses it if the preflight fails or breaks a configured limit; when the client supports it, the user is asked to confirm. A refused order comes back with "submitted": false and is not sent. For a recurring market such as a 15-minute window, find the window with get_current_event, its contracts with get_event_details, and the result with wait_for_settlement.
Args: contract_symbol: The contract to buy, from get_event_details, e.g. "KALSHI.KXBTC15M-26OCT201200-00.Y" (".Y" = YES, ".N" = NO). Not the "-EVENTCONTRACT" symbol that get_event_contract_bars takes. quantity: Number of contracts (default "1"); at most 2 decimal places. limit_price: Most to pay per contract, in dollars with whole cents between 0.01 and 0.99 (e.g. "0.55"). If omitted, the contract's current ask is looked up via event_symbol and rounded up to a whole cent. event_symbol: The contract's eventSymbol, e.g. "KALSHI.KXBTC15M-26OCT201200". Required when limit_price is omitted. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: contract_symbol (required), quantity, account_id, limit_price, +1 more. Returns: result
cancel_and_replace_orderADestructive
Atomically cancel an existing order and replace it with new parameters.
⚠️ This modifies an existing order. Before submitting, the server looks up the original order, preflights the replacement and refuses it if the preflight fails or breaks a configured limit; when the client supports it, the user is asked to confirm. A refused request comes back with "submitted": false and the original order is left as it was.
Supported for equity, option, and crypto quantity orders.
Args: order_id: UUID of the existing order to cancel and replace. order_type: MARKET, LIMIT, STOP, STOP_LIMIT, MARKET_ON_CLOSE or LIMIT_ON_CLOSE for the replacement. time_in_force: DAY or GTD. Default is DAY. quantity: New quantity for the replacement order. Mutually exclusive with amount. amount: New notional dollar amount for the replacement order. Mutually exclusive with quantity. limit_price: New limit price. Required for LIMIT, STOP_LIMIT and LIMIT_ON_CLOSE replacements. stop_price: New stop price (for STOP/STOP_LIMIT orders). expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: order_id (required), order_type (required), amount, quantity, +5 more. Returns: result
cancel_orderADestructiveIdempotent
Cancel an existing order.
Note: While most cancellations are processed immediately during market hours, this is not guaranteed. Use get_order to confirm cancellation.
Args: order_id: The UUID of the order to cancel. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: order_id (required), account_id. Returns: result
check_setupARead-only
Verify that the Public.com API credentials are configured correctly.
Checks the PUBLIC_COM_SECRET environment variable and attempts to authenticate. Run this first to confirm connectivity.
Inputs: no named parameters. Returns: result
flatten_and_go_shortADestructive
Sell any existing long position in a symbol, then place a short-sale order.
⚠️ Experimental — this is a two-order workflow, not atomic. Market conditions may change between the flatten fill and the short entry. Both orders execute as real trades.
Each order is preflighted just before it is sent. The server preflights the flatten (a MARKET sell of the whole long position) and asks the user to confirm the whole workflow when the client supports it. After the flatten fills, it preflights the short and checks it against the configured limits. If that check fails, the short is not placed and the account is left flat: the response then has status "flattened_not_shorted" and the flatten's order ID. If the user cancels or the first preflight fails, the response has "submitted": false and nothing is sent.
If no long position exists the flatten step is skipped, and the short is preflighted and confirmed like place_short_order.
Args: symbol: Ticker symbol (e.g. "AAPL"). short_quantity: Number of shares to short after flattening. order_type: MARKET, LIMIT, STOP, STOP_LIMIT, MARKET_ON_CLOSE or LIMIT_ON_CLOSE. Default is MARKET. The on-close types execute at the closing auction. time_in_force: DAY or GTD. Default is DAY. limit_price: Required for LIMIT, STOP_LIMIT and LIMIT_ON_CLOSE orders. stop_price: Required for STOP and STOP_LIMIT orders. expiration_time: Required when time_in_force is GTD. ISO 8601 format. equity_market_session: CORE or EXTENDED. flatten_timeout: Seconds to wait for the flatten order to fill (default 60). account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: symbol (required), short_quantity (required), account_id, order_type, +6 more. Returns: result
get_accountsARead-only
List all brokerage accounts associated with the API key.
Returns account IDs and types (BROKERAGE, HIGH_YIELD, etc.).
Inputs: no named parameters. Returns: result
get_all_instrumentsARead-only
List all available tradeable instruments with optional filters.
Args: type_filter: Filter by instrument types (e.g. ["EQUITY", "CRYPTO"]). Valid: EQUITY, CRYPTO, OPTION, ALT, BOND, INDEX, TREASURY, EVENTCONTRACT. trading_filter: Filter by trading status (e.g. ["BUY_AND_SELL"]). Valid: BUY_AND_SELL, LIQUIDATION_ONLY, DISABLED. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: account_id, type_filter, trading_filter. Returns: result
get_bond_detailsARead-only
Get comprehensive details for a single bond.
Returns pricing, ratings, coupon schedule, maturity, and call information for the bond identified by its symbol.
Args: symbol: Bond symbol, typically CUSIP-BOND format (e.g. "912810TM0-BOND"). account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: symbol (required), account_id. Returns: result
get_current_eventARead-only
Find the event of a recurring market that is trading right now.
For a 15-minute "Up or Down" series such as "KXBTC15M" this is the current window: the open event of the series that closes soonest. Windows whose resolution time has passed are skipped, even though the API keeps listing them as unresolved for a few minutes after they close. Pass the returned eventSymbol to get_event_details for the YES/NO contracts and their asks, then preflight_buy_event_contract to price a buy.
Args:
series: Series ticker, e.g. "KXBTC15M" — the series field of
get_event_summary / get_event_details results.
frequency: How often the series recurs. Default FIFTEEN_MINUTES; e.g.
ONE_HOUR for hourly series.
category: Only search this category (from get_event_categories), e.g. "Crypto".
Narrowing the search makes it faster.
subcategory: Only search this subcategory, e.g. "BTC".
wait_seconds: If no event is open yet, keep checking for up to this many
seconds (0 to 120; default 0 = check once). Between windows, the next
one is typically listed a minute or two after the previous one closes.
Inputs: series (required), category, frequency, subcategory, +1 more. Returns: result
get_event_categoriesARead-only
List the categories for browsing event contracts (prediction markets).
Each category carries its subcategories and the frequency filters it
supports. Pass a returned category (and optionally subcategory) to
get_event_summary to browse the events in it.
Inputs: no named parameters. Returns: result
get_event_contract_barsARead-only
Get price-history bars for up to 8 event contracts of one event.
Prices and OHLC values are in dollars (0.00 to 1.00) for the side the symbol names — a ".N" symbol carries the NO prices — and equal the implied probability (multiply by 100 for cents / percent). Bars start at the first period with a price, so charts in one response can start at different timestamps: align them by timestamp, not by index. A symbol is left out of the response when it is unknown or has no price in the period.
This endpoint takes the charting identifiers, not the discovery ones that get_event_summary / get_event_details use.
Args: event_id: The "-EVENT" grouping id the contracts belong to, e.g. "KALSHI.KXBALANCESHEET-EO26-EVENT". The API rejects an id that is not an -EVENT id. period: DAY, WEEK, MONTH, or ALL. Measured back from now, or from the event's close time once it has stopped trading. symbols: 1 to 8 "-EVENTCONTRACT" symbols of that event, e.g. ["KALSHI.KXBALANCESHEET-EO26-6.6.Y-EVENTCONTRACT"].
Inputs: period (required), symbols (required), event_id (required). Returns: result
get_event_detailsARead-only
Get full details for one event contract (prediction-market event).
Returns the event's outcomes (each with its floorStrike when it has one),
the YES/NO contracts for each outcome with current pricing (bid, ask, last,
probability, open interest, daily gain), the trading timeline (open, close,
expected expiration, settlement), and the CFTC contract terms. Prices are in
dollars between 0.00 and 1.00 and equal the implied probability. Outcome ids
carry no exchange prefix (e.g. "KXBALANCESHEET-EO26-6.6"); contract symbols do.
Each outcome also carries shortcuts derived by the SDK: tradable (open, in
BUY_AND_SELL mode and before its close time — state alone can still read
STATE_OPEN after close), secondsLeft until close, and once settled YES or NO,
winner (the contract symbol that paid out). The event carries series, its
series ticker.
Args: event_symbol: The eventSymbol from get_event_summary, e.g. "KALSHI.KXBALANCESHEET-EO26". Not the "-EVENT" id that get_event_contract_bars takes. An unknown eventSymbol returns an error with code 7004. include_all_outcomes: True (default) returns every outcome; False returns a short list of up to 8. outcomeCount always reports the full total.
Inputs: event_symbol (required), include_all_outcomes. Returns: result
get_event_summaryARead-only
Browse event contracts (prediction-market events), one page at a time.
Returns up to 100 events per page, each with its eventSymbol, title, volume,
resolution time, resolved/halted flags, category, related instrument symbols
(e.g. BTC-CRYPTO; often empty — these are NOT the event's contracts), and
series, the series ticker of a recurring market (e.g. "KXBTC15M"; derived
from the eventSymbol, pass it to get_current_event). Pass an eventSymbol to
get_event_details for its outcomes, YES/NO contracts and pricing.
Results can include resolved and halted events. When the response carries a
nextToken, call again with the same arguments plus that next_token to fetch
the next page; it is absent on the last page.
eventSymbol (e.g. "KALSHI.KXBALANCESHEET-EO26") is the discovery identifier. It is NOT the "-EVENT" id that get_event_contract_bars takes.
Args: sorting_mode: VOLUME (default), EXPIRATION, or RECENTLY_ADDED. category: Only events in this category (from get_event_categories). subcategory: Only events in this subcategory. event_symbols: Only these events, by eventSymbol. frequencies: Only events recurring at these frequencies. Any of ALL, ONCE, FIFTEEN_MINUTES, ONE_HOUR, ONE_DAY, ONE_WEEK, ONE_MONTH, ONE_YEAR. resolution_time_start: Only events resolving at or after this ISO 8601 timestamp (e.g. 2026-12-31T00:00:00Z). resolution_time_end: Only events resolving at or before this ISO 8601 timestamp. display_resolved_events: Include (true) or exclude (false) resolved events. Omit for the API default. created_within_days: Only events created within the last N days. next_token: The nextToken from the previous page, to fetch the next one.
Inputs: category, next_token, frequencies, subcategory, +6 more. Returns: result
get_historyARead-only
Retrieve account transaction history.
Returns trades, money movements (deposits, withdrawals, dividends), and position adjustments (splits, mergers).
Args: account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. start: Start timestamp in ISO 8601 format (e.g. 2025-01-15T09:00:00-05:00). end: End timestamp in ISO 8601 format. page_size: Max number of records to return. next_token: Pagination token for the next page.
Inputs: end, start, page_size, account_id, +1 more. Returns: result
get_instrumentARead-only
Get details about a specific tradeable instrument.
Returns trading status, fractional trading availability, and option trading capabilities.
Args: symbol: Ticker symbol (e.g. "AAPL"). instrument_type: One of EQUITY, CRYPTO, OPTION, INDEX, ALT, BOND, TREASURY, EVENTCONTRACT. Default is EQUITY.
Inputs: symbol (required), instrument_type. Returns: result
get_option_chainARead-only
Get the full option chain (calls and puts) for a symbol and expiration.
Args: symbol: Underlying ticker symbol (e.g. "AAPL"). expiration_date: Expiration date in YYYY-MM-DD format. instrument_type: EQUITY or UNDERLYING_SECURITY_FOR_INDEX_OPTION. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: symbol (required), expiration_date (required), account_id, instrument_type. Returns: result
get_option_expirationsARead-only
Get available option expiration dates for a symbol.
Args: symbol: Underlying ticker symbol (e.g. "AAPL"). instrument_type: EQUITY or UNDERLYING_SECURITY_FOR_INDEX_OPTION. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: symbol (required), account_id, instrument_type. Returns: result
get_option_greekARead-only
Get option Greeks (delta, gamma, theta, vega, rho, IV) for a single option symbol.
Args: osi_symbol: OSI-normalized option symbol (e.g. "AAPL260320C00280000"). account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: osi_symbol (required), account_id. Returns: result
get_option_greeksBRead-only
Get option Greeks (delta, gamma, theta, vega, rho, IV) for option symbols.
Args: osi_symbols: List of OSI-normalized option symbols (e.g. ["AAPL260320C00280000"]). account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: osi_symbols (required), account_id. Returns: result
get_orderARead-only
Get the status and details of a specific order, including its fills.
Returns the order with trades (each fill's tradeId, quantity, price, side,
timestamp and, when reported, marketIdentificationCode — the ISO 10383 MIC
of the execution venue, e.g. XNAS), filledAt, replacedAt, lastModified
and equityMarketSession. equityMarketSession reports the session as REGULAR,
REST_OF_DAY or TWENTY_FOUR_HOURS.
Only orders created within the last 30 days can be looked up; older orders return a not-found error. Order placement is asynchronous, so this may also return an error for an order that was just placed and has not yet been indexed.
An order that belongs to a bracket carries a bracketId — the order ID of the bracket's entry order. Pass that ID to get_orders to find the sibling legs.
Args: order_id: The UUID of the order to look up. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: order_id (required), account_id. Returns: result
get_ordersARead-only
Get all open/active orders on the account.
Fetches the account portfolio and returns only the orders list. Returns order details including symbol, side, type, status, quantity, and prices.
Orders that belong to a bracket carry a bracketId — the order ID of the bracket's entry order — which groups the entry and its exit legs together.
Args: account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: account_id. Returns: result
get_portfolioARead-only
Get a snapshot of the account portfolio.
Returns positions, equity breakdown, buying power, open orders, and cash/withdrawal figures (including cash, totalAccountValue, and availableToWithdraw). Only non-IRA accounts are supported.
buyingPower includes dayTradeBuyingPower, the buying power available for
day trading. It equals buyingPower when the account is not enabled for
day-trade buying power, and is omitted when the API does not report it.
Args: account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: account_id. Returns: result
get_price_historyARead-only
Get historical OHLCV price bars for a symbol over a time period.
Returns open/high/low/close/volume bars split into pre-market, regular, and after-hours sessions, plus previous close and total gain/loss. Use this for trend analysis and historical prices — get_quotes returns the current price only, and get_history is account activity, not prices.
Args:
symbol: Ticker symbol (e.g. "AAPL").
period: Time window to retrieve (e.g. "YEAR", "TEN_YEARS", "ALL").
instrument_type: EQUITY, CRYPTO, OPTION, INDEX, or EVENTCONTRACT.
Default EQUITY. To chart several contracts of one event side by
side, get_event_contract_bars is usually the better fit.
aggregation: Optional bar size. Prefer omitting it — the server then
picks an appropriate size for the period. Only a subset of sizes
is valid per period (finer/coarser sizes are rejected); if you set
an invalid one, the error lists the valid options.
purchase_date: Required only when period is "SINCE_PURCHASE".
Format "YYYY-MM-DD".
trading_session_toggle: Which sessions to include on the DAY equity
chart. Omit for the default (REGULAR_AND_EXTENDED_HOURS,
04:00–20:00 ET). REGULAR_HOURS limits to 09:30–16:00. ALL_SESSIONS
returns a full midnight-to-midnight chart including the overnight
ATS sessions, adding preMarketOvernight (00:00–04:00) and
postMarketOvernight (20:00–24:00) to the response.
ipo_date: Optional IPO / first-trade date of the asset. Format
"YYYY-MM-DD". When the asset is younger than the requested period,
the server fetches a finer aggregation over the available post-IPO
history (so the chart isn't a straight diagonal) and adds a
leadingFill object to the response describing the flat lead-in
to draw for the pre-IPO portion (startTimestamp, endTimestamp,
value, count, includedInTotalExpectedBars). Omit for unchanged
behavior. Ignored for the DAY chart; leadingFill is also never
emitted for the ALL / SINCE_PURCHASE periods.
Inputs: period (required), symbol (required), ipo_date, aggregation, +3 more. Returns: result
get_quotesARead-only
Get real-time quotes for one or more symbols.
Returns last price, bid, ask, volume, and other market data.
Args: symbols: List of ticker symbols (e.g. ["AAPL", "GOOGL"]). instrument_type: Type for all symbols. One of EQUITY, CRYPTO, OPTION, INDEX, ALT, BOND, TREASURY, EVENTCONTRACT. Default is EQUITY. For mixed types, call this tool multiple times. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: symbols (required), account_id, instrument_type. Returns: result
get_strategy_quoteARead-only
Get a consolidated quote for a multi-leg option strategy.
Prices the strategy as a whole (debit/credit, bid/ask/mark, net price) from its option legs and optional equity leg. This is a read-only quote — it does NOT place or preflight an order.
Args: base_symbol: Underlying ticker for the strategy (e.g. "SPY"). option_legs: List of option leg objects. Each leg must have: - symbol (str): The option OCC symbol (e.g. "SPY260313P00670000") - side (str): BUY or SELL - open_close_indicator (str, optional): OPEN or CLOSE - ratio_quantity (int, optional): Ratio between legs (default 1) Example: [{"symbol": "SPY260313P00670000", "side": "SELL", "open_close_indicator": "OPEN", "ratio_quantity": 1}, {"symbol": "SPY260313P00665000", "side": "BUY", "open_close_indicator": "OPEN", "ratio_quantity": 1}] equity_leg: Optional equity leg (same shape as an option leg, with an equity ticker as the symbol) for strategies that pair options with stock (e.g. a covered call or collar). account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: base_symbol (required), option_legs (required), account_id, equity_leg. Returns: result
get_tax_lotsARead-only
Get the unrealized tax-lot summary for the account.
Returns per-lot unrealized gain/loss, holding term (short/long/60-40),
cost basis, and the aggregate totals across all lots. Requires the API
key to have the trading.read scope.
Args: account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: account_id. Returns: result
get_tax_lots_csvARead-only
Export the unrealized tax lots as a CSV file.
Returns a file object with fileName and base64Data. The CSV contents
are Base64-encoded in the base64Data field — decode it to recover the
raw CSV text. Requires the API key to have the trading.read scope.
Args: account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: account_id. Returns: result
get_tax_lots_for_symbolARead-only
Get the unrealized tax-lot detail for a single symbol.
Returns each open lot for the symbol with its unrealized gain/loss,
holding term, and cost basis. Requires the API key to have the
trading.read scope.
Args: symbol: Ticker symbol (e.g. "AAPL"). price: Optional price (as a numeric string) to value the lots against. Omit to use the current market price. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: symbol (required), price, account_id. Returns: result
place_call_credit_spreadA
Place a Bear Call Spread (call credit spread).
Sell a lower-strike call, buy a higher-strike call. Receives a net credit. ⚠️ This executes a real trade. Before submitting, the server preflights this exact spread and refuses it if the preflight fails or breaks a configured limit; when the client supports it, the user is asked to confirm. A refused order comes back with "submitted": false and is not sent.
Args: sell_contract_osi: OSI symbol of the call to sell (lower strike). buy_contract_osi: OSI symbol of the call to buy (higher strike). quantity: Number of spreads. limit_price: Minimum net credit to receive per spread. time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: quantity (required), limit_price (required), buy_contract_osi (required), sell_contract_osi (required), +3 more. Returns: result
place_call_debit_spreadA
Place a Bull Call Spread (call debit spread).
Buy a lower-strike call, sell a higher-strike call. Pays a net debit. ⚠️ This executes a real trade. Before submitting, the server preflights this exact spread and refuses it if the preflight fails or breaks a configured limit; when the client supports it, the user is asked to confirm. A refused order comes back with "submitted": false and is not sent.
Args: sell_contract_osi: OSI symbol of the call to sell (higher strike). buy_contract_osi: OSI symbol of the call to buy (lower strike). quantity: Number of spreads. limit_price: Maximum net debit to pay per spread. time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: quantity (required), limit_price (required), buy_contract_osi (required), sell_contract_osi (required), +3 more. Returns: result
place_multileg_orderA
Place a multi-leg order (options strategies: spreads, straddles, etc.).
⚠️ This executes a real trade. Before submitting, the server preflights this exact order and refuses it if the preflight fails or breaks a configured limit; when the client supports it, the user is asked to confirm. A refused order comes back with "submitted": false and is not sent.
Args: legs: List of leg objects. Each leg must have: - symbol (str): The option/equity symbol (e.g. "SPY260313P00670000") - type (str): EQUITY or OPTION - side (str): BUY or SELL - open_close_indicator (str, optional): OPEN or CLOSE (required for options) - ratio_quantity (int, optional): Ratio between legs (default 1) Example: [{"symbol": "SPY260313P00670000", "type": "OPTION", "side": "SELL", "open_close_indicator": "OPEN", "ratio_quantity": 1}, {"symbol": "SPY260313P00665000", "type": "OPTION", "side": "BUY", "open_close_indicator": "OPEN", "ratio_quantity": 1}] quantity: Number of spreads. Must be > 0. limit_price: Limit price. Positive for debit, negative for credit. time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: legs (required), quantity (required), limit_price (required), account_id, +2 more. Returns: result
place_orderA
Place a single-leg order (buy/sell stocks, crypto, or options).
⚠️ This executes a real trade. Before submitting, the server preflights this exact order and refuses it if the preflight fails or breaks a configured limit; when the client supports it, the user is asked to confirm. A refused order comes back with "submitted": false and is not sent.
Args:
symbol: Ticker symbol (e.g. "AAPL").
instrument_type: EQUITY, OPTION, or CRYPTO.
order_side: BUY or SELL.
order_type: MARKET, LIMIT, STOP, STOP_LIMIT, MARKET_ON_CLOSE or
LIMIT_ON_CLOSE. The on-close types execute at the closing auction.
time_in_force: DAY or GTD. Default is DAY.
quantity: Number of shares/contracts (mutually exclusive with amount).
amount: Dollar amount (mutually exclusive with quantity).
limit_price: Required for LIMIT, STOP_LIMIT and LIMIT_ON_CLOSE orders.
stop_price: Required for STOP and STOP_LIMIT orders.
open_close_indicator: For options only — OPEN or CLOSE.
expiration_time: Required when time_in_force is GTD. ISO 8601 format.
equity_market_session: CORE or EXTENDED. For equity orders only. Not the
REGULAR / REST_OF_DAY / TWENTY_FOUR_HOURS values that get_order and
search_orders report in equityMarketSession; never feed those back here.
tax_lot_matching_instructions: Optional list of specific tax lots to
sell, each a dict {"tax_lot_id": str, "quantity": str}. Constraints
enforced by the API: at most 8 per request; only for a SELL equity
order with open_close_indicator=CLOSE; every lot must be the same
symbol as the order; only MARKET or good-for-day LIMIT orders;
the quantities must sum to the order quantity; and the account's
tax-lot information must have been updated today. Omit to let the
broker apply its default lot-matching.
order_class: SIMPLE (default) places a standalone order. BRACKET, OCO or
OTO place a bracket order, where the exit legs below are submitted
automatically once this entry order fills. Bracket orders are for
EQUITY and OPTION only, need a whole-share quantity (not amount),
must use the CORE market session, and the entry order_type must be
LIMIT or MARKET — LIMIT only for OCO. Every leg of the bracket,
entry included, reports the entry's order ID as its bracketId.
preflight_order cannot check the exit legs — it validates the entry
order only.
take_profit_limit_price: Limit price of the take-profit exit leg, placed
on the opposite side of the entry. Requires a bracket order_class.
stop_loss_stop_price: Stop price of the stop-loss exit leg, placed on the
opposite side of the entry. Requires a bracket order_class. Placed as
a STOP order unless stop_loss_limit_price is given too.
stop_loss_limit_price: Limit price that makes the stop-loss leg a
STOP_LIMIT order instead of a STOP order. Requires
stop_loss_stop_price.
account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: symbol (required), order_side (required), order_type (required), instrument_type (required), +14 more. Returns: result
place_put_credit_spreadA
Place a Bull Put Spread (put credit spread).
Sell a higher-strike put, buy a lower-strike put. Receives a net credit. ⚠️ This executes a real trade. Before submitting, the server preflights this exact spread and refuses it if the preflight fails or breaks a configured limit; when the client supports it, the user is asked to confirm. A refused order comes back with "submitted": false and is not sent.
Args: sell_contract_osi: OSI symbol of the put to sell (higher strike). buy_contract_osi: OSI symbol of the put to buy (lower strike). quantity: Number of spreads. limit_price: Minimum net credit to receive per spread. time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: quantity (required), limit_price (required), buy_contract_osi (required), sell_contract_osi (required), +3 more. Returns: result
place_put_debit_spreadA
Place a Bear Put Spread (put debit spread).
Buy a higher-strike put, sell a lower-strike put. Pays a net debit. ⚠️ This executes a real trade. Before submitting, the server preflights this exact spread and refuses it if the preflight fails or breaks a configured limit; when the client supports it, the user is asked to confirm. A refused order comes back with "submitted": false and is not sent.
Args: sell_contract_osi: OSI symbol of the put to sell (lower strike). buy_contract_osi: OSI symbol of the put to buy (higher strike). quantity: Number of spreads. limit_price: Maximum net debit to pay per spread. time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: quantity (required), limit_price (required), buy_contract_osi (required), sell_contract_osi (required), +3 more. Returns: result
place_short_orderA
Place an equity short-sale order.
⚠️ This executes a real trade. Before submitting, the server preflights this exact order and refuses it if the preflight fails or breaks a configured limit; when the client supports it, the user is asked to confirm. A refused order comes back with "submitted": false and is not sent.
Args: symbol: Ticker symbol to short (e.g. "AAPL"). quantity: Number of shares to short. order_type: MARKET, LIMIT, STOP, STOP_LIMIT, MARKET_ON_CLOSE or LIMIT_ON_CLOSE. Default is MARKET. The on-close types execute at the closing auction. time_in_force: DAY or GTD. Default is DAY. limit_price: Required for LIMIT, STOP_LIMIT and LIMIT_ON_CLOSE orders. stop_price: Required for STOP and STOP_LIMIT orders. expiration_time: Required when time_in_force is GTD. ISO 8601 format. equity_market_session: CORE or EXTENDED. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: symbol (required), quantity (required), account_id, order_type, +5 more. Returns: result
preflight_buy_event_contractARead-only
Price a buy of an event contract (a YES or NO side) without placing it.
Prices a DAY limit buy of the contract. The response holds the limit price used and the preflight estimate, whose estimatedCost includes the commission and exchange fee. Does NOT place an order.
Args: contract_symbol: The contract to buy, from get_event_details, e.g. "KALSHI.KXBTC15M-26OCT201200-00.Y" (".Y" = YES, ".N" = NO). Not the "-EVENTCONTRACT" symbol that get_event_contract_bars takes. quantity: Number of contracts (default "1"); at most 2 decimal places. limit_price: Most to pay per contract, in dollars with whole cents between 0.01 and 0.99 (e.g. "0.55"). If omitted, the contract's current ask is looked up via event_symbol and rounded up to a whole cent. event_symbol: The contract's eventSymbol, e.g. "KALSHI.KXBTC15M-26OCT201200". Required when limit_price is omitted. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: contract_symbol (required), quantity, account_id, limit_price, +1 more. Returns: result
preflight_call_credit_spreadARead-only
Estimate costs for a Bear Call Spread (call credit spread) before placing it.
Sell a lower-strike call, buy a higher-strike call. Receives a net credit. Does NOT place an order.
Args: sell_contract_osi: OSI symbol of the call to sell (lower strike). buy_contract_osi: OSI symbol of the call to buy (higher strike). quantity: Number of spreads. limit_price: Net credit to receive per spread (positive = credit received). time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: quantity (required), limit_price (required), buy_contract_osi (required), sell_contract_osi (required), +3 more. Returns: result
preflight_call_debit_spreadARead-only
Estimate costs for a Bull Call Spread (call debit spread) before placing it.
Buy a lower-strike call, sell a higher-strike call. Pays a net debit. Does NOT place an order.
Args: sell_contract_osi: OSI symbol of the call to sell (higher strike). buy_contract_osi: OSI symbol of the call to buy (lower strike). quantity: Number of spreads. limit_price: Net debit to pay per spread (positive = debit paid). time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: quantity (required), limit_price (required), buy_contract_osi (required), sell_contract_osi (required), +3 more. Returns: result
preflight_multileg_orderARead-only
Estimate costs for a multi-leg (options strategy) trade before placing it.
Does NOT place an order.
Args: legs: List of leg objects. Each leg must have: - symbol (str): The option/equity symbol (e.g. "SPY260313P00670000") - type (str): EQUITY or OPTION - side (str): BUY or SELL - open_close_indicator (str, optional): OPEN or CLOSE (required for options) - ratio_quantity (int, optional): Ratio between legs (default 1) Example: [{"symbol": "SPY260313P00670000", "type": "OPTION", "side": "SELL", "open_close_indicator": "OPEN", "ratio_quantity": 1}, {"symbol": "SPY260313P00665000", "type": "OPTION", "side": "BUY", "open_close_indicator": "OPEN", "ratio_quantity": 1}] limit_price: The limit price for the spread. time_in_force: DAY or GTD. Default is DAY. quantity: Number of spreads. Must be > 0. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: legs (required), limit_price (required), quantity, account_id, +2 more. Returns: result
preflight_orderARead-only
Estimate costs and impact of a potential single-leg trade before placing it.
Returns estimated commission, regulatory fees, order value, buying power requirements, and margin impact. Does NOT place an order.
Args: symbol: Ticker symbol (e.g. "AAPL"). instrument_type: EQUITY, OPTION, or CRYPTO. order_side: BUY or SELL. order_type: MARKET, LIMIT, STOP, STOP_LIMIT, MARKET_ON_CLOSE or LIMIT_ON_CLOSE. The on-close types execute at the closing auction. time_in_force: DAY or GTD. Default is DAY. quantity: Number of shares/contracts (mutually exclusive with amount). amount: Dollar amount (mutually exclusive with quantity). limit_price: Required for LIMIT, STOP_LIMIT and LIMIT_ON_CLOSE orders. stop_price: Required for STOP and STOP_LIMIT orders. open_close_indicator: For options only — OPEN or CLOSE. expiration_time: Required when time_in_force is GTD. ISO 8601 format. equity_market_session: CORE or EXTENDED. For equity orders only. tax_lot_matching_instructions: Optional list of specific tax lots to sell, each a dict {"tax_lot_id": str, "quantity": str}. Constraints enforced by the API: at most 8 per request; only for a SELL equity order with open_close_indicator=CLOSE; every lot must be the same symbol as the order; only MARKET or good-for-day LIMIT orders; the quantities must sum to the order quantity; and the account's tax-lot information must have been updated today. Omit to let the broker apply its default lot-matching. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: symbol (required), order_side (required), order_type (required), instrument_type (required), +10 more. Returns: result
preflight_put_credit_spreadARead-only
Estimate costs for a Bull Put Spread (put credit spread) before placing it.
Sell a higher-strike put, buy a lower-strike put. Receives a net credit. Does NOT place an order.
Args: sell_contract_osi: OSI symbol of the put to sell (higher strike). buy_contract_osi: OSI symbol of the put to buy (lower strike). quantity: Number of spreads. limit_price: Net credit to receive per spread (positive = credit received). time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: quantity (required), limit_price (required), buy_contract_osi (required), sell_contract_osi (required), +3 more. Returns: result
preflight_put_debit_spreadARead-only
Estimate costs for a Bear Put Spread (put debit spread) before placing it.
Buy a higher-strike put, sell a lower-strike put. Pays a net debit. Does NOT place an order.
Args: sell_contract_osi: OSI symbol of the put to sell (lower strike). buy_contract_osi: OSI symbol of the put to buy (higher strike). quantity: Number of spreads. limit_price: Net debit to pay per spread (positive = debit paid). time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: quantity (required), limit_price (required), buy_contract_osi (required), sell_contract_osi (required), +3 more. Returns: result
preflight_short_orderARead-only
Estimate costs for a short-sale equity order before placing it.
Returns estimated commission, fees, and buying power impact. Does NOT place an order.
Args: symbol: Ticker symbol to short (e.g. "AAPL"). quantity: Number of shares to short. order_type: MARKET, LIMIT, STOP, STOP_LIMIT, MARKET_ON_CLOSE or LIMIT_ON_CLOSE. Default is MARKET. The on-close types execute at the closing auction. time_in_force: DAY or GTD. Default is DAY. limit_price: Required for LIMIT, STOP_LIMIT and LIMIT_ON_CLOSE orders. stop_price: Required for STOP and STOP_LIMIT orders. expiration_time: Required when time_in_force is GTD. ISO 8601 format. equity_market_session: CORE or EXTENDED. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Inputs: symbol (required), quantity (required), account_id, order_type, +5 more. Returns: result
search_bondsARead-only
Filtered, paged search for fixed income (bond) instruments.
All filters are optional; combine them to narrow down results. Returns a
page object with content (the bonds), totalElements, and totalPages.
Args: page_number: Page number, zero-based. Default 0. page_size: Items per page. Default 20. sort_property: Property to sort by (e.g. "maturityDate"). sort_direction: ASC or DESC. Default DESC. issuer: Filter by issuer name. issuer_symbol: Filter by issuer symbol(s), e.g. ["AAPL"]. bond_status: e.g. ["OUTSTANDING"]. Valid: LIQUIDATED, CONVERTED, FUNGED, REPAID, RESTRUCTURED, CALLED, DEFAULTED, MATURED, OUTSTANDING, PUT, TENDERED, REPURCHASED, PRE_ISSUANCE, UNKNOWN. bond_type: e.g. ["TREASURY", "CORPORATE"]. Valid: AGENCY, CD, CORPORATE, GOVERNMENT, MUNICIPAL, TREASURY. treasury_subtype: Valid: BOND, BILL, NOTE, STRIPS, TIPS, FLOATING. rating: S&P rating(s), e.g. ["AAA", "AA+"]. From AAA through D, NR for not rated (short-term ratings like A-1+/SP-1 also valid). rating_category: INVESTMENT_GRADE or SPECULATIVE_GRADE. sp_outlook: Valid: POSITIVE, NEGATIVE, DEVELOPING, STABLE, NOT_RATED, NOT_MEANINGFUL. sp_creditwatch: Valid: POSITIVE, NEGATIVE, DEVELOPING, NOT_MEANINGFUL. coupon_frequency: Valid: AT_MATURITY, ZERO, MONTHLY, QUARTERLY, SEMI_ANNUAL, ANNUAL. min_coupon: Minimum coupon rate (numeric string). max_coupon: Maximum coupon rate (numeric string). min_maturity_date: yyyy-MM-dd. Defaults server-side to today + 14 days. max_maturity_date: yyyy-MM-dd. min_current_yield: Minimum current yield (numeric string). max_current_yield: Maximum current yield (numeric string). min_par_value: Minimum par value (numeric string). max_par_value: Maximum par value (numeric string). min_liquidity_rating: Minimum liquidity score, 1 (low) to 5 (high). max_liquidity_rating: Maximum liquidity score, 1 (low) to 5 (high). liquidity_rating: Specific liquidity score(s), 1–5. callable: Filter by callable status. perpetual: Filter by perpetual bond status. partial_par: Filter by partial par status.
Inputs: issuer, rating, callable, bond_type, +24 more. Returns: result
search_ordersARead-only
Search the account's order history — orders in ANY status, created in the last 30 days.
This is the order-history tool. It differs from get_orders, which returns only the open/active orders embedded in the portfolio snapshot: search_orders queries the order-history endpoint and also returns filled, cancelled, rejected, expired and replaced orders, narrowed by the filters below. All filters are optional and combine with AND; call it with no filters to list every order in the window.
Limits (enforced by the API): only orders created within the last 30 days are searchable, and at most 500 orders are returned — narrow with created_after / created_before or the other filters if a search could exceed that.
Each result has the same shape as get_order: the order plus trades (the
individual fills: tradeId, quantity, price, side, timestamp and, when
reported, marketIdentificationCode — the MIC of the execution venue), filledAt,
replacedAt, lastModified and equityMarketSession. equityMarketSession
reports the session an equity order was placed for as REGULAR, REST_OF_DAY or
TWENTY_FOUR_HOURS.
Args: account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. status: Only orders currently in this status. One of NEW, PARTIALLY_FILLED, FILLED, CANCELLED, QUEUED_CANCELLED, PENDING_CANCEL, PENDING_REPLACE, REPLACED, REJECTED, EXPIRED. side: BUY or SELL. symbols: Only orders for these instruments, each as "SYMBOL" or "SYMBOL:TYPE" (type defaults to EQUITY), e.g. ["AAPL", "BTC:CRYPTO", "SPY260313P00670000:OPTION"]. security_type: Only orders of this instrument type. One of EQUITY, OPTION, MULTI_LEG_INSTRUMENT, CRYPTO, ALT, TREASURY, BOND, INDEX, EVENTCONTRACT. open_close_indicator: OPEN or CLOSE (set on option and shorting orders only). created_after: Only orders created at or after this ISO 8601 timestamp (e.g. 2026-09-01T00:00:00Z). Cannot reach back more than 30 days. created_before: Only orders created before this ISO 8601 timestamp.
Inputs: side, status, symbols, account_id, +4 more. Returns: result
wait_for_settlementARead-only
Wait for an event's outcome to settle and report which side won.
A 15-minute window settles a few minutes after it closes, which can be longer than one call waits: on a timeout the response has status "pending" and the outcome's current state — call again to keep waiting.
Once settled, the response carries the outcome (with settledOutcome, e.g.
SETTLED_OUTCOME_YES), winner (the contract symbol that paid out, absent for any
settlement other than YES/NO), and, if contract_symbol was given, won.
Args: event_symbol: The eventSymbol, e.g. "KALSHI.KXBTC15M-26OCT201200". outcome_id: The outcome to watch (outcomeId from get_event_details). May be omitted for an event with a single outcome, such as a 15-minute "Up or Down" window. contract_symbol: Optional contract you hold or bought, e.g. "KALSHI.KXBTC15M-26OCT201200-00.Y", to report whether it won. timeout_seconds: How long to wait in this call (0 to 120; default 60). 0 checks once.
Inputs: event_symbol (required), outcome_id, contract_symbol, timeout_seconds. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 46 tools
Most tools target a clearly distinct resource+action, and the descriptions proactively disambiguate tricky pairs like get_orders vs search_orders and get_history vs get_price_history. The notable flaw is get_option_greek vs get_option_greeks, which differ only by plurality, plus the four named spread tools that overlap with place_multileg_order (mitigated by clear docs).
The set is overwhelmingly consistent snake_case verb_noun (get_*, place_*, preflight_*, cancel_*), which makes the place/preflight pairing very predictable. The main blemish is the singular/plural collision get_option_greek vs get_option_greeks, and a few names like flatten_and_go_short that break the verb_noun mold.
46 tools is heavy for one server and a meaningful share is redundant surface: six preflight_* tools mirror the six place_* tools argument-for-argument (a dry_run flag would do), and the four named spread tools duplicate place_multileg_order. The breadth (equities, options, bonds, event contracts, tax lots) justifies many tools, but not this many.
Coverage is genuinely broad: account/portfolio reads, full order lifecycle (place, preflight, get, search, cancel, cancel-and-replace), quotes, price history, instruments, bonds, option chains/Greeks/expirations, event contracts, and tax lots. Gaps are minor conveniences rather than blockers—no cancel-all or bulk position-close, and the 30-day order lookup window is an API constraint agents can work around.
Maintenance
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
Official Intrinio MCP server. US stock prices, options and fundamentals for AI agents.
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceThis MCP server interacts with the Interactive Brokers API to fetch portfolio details, enabling portfolio management through natural language.65-
- AlicenseNot gradedqualityDmaintenanceAn MCP server implementation for Alpaca's Trading API that enables LLMs to interact with Alpaca's trading infrastructure using natural language, supporting stock, options, and crypto trading, portfolio management, watchlists, and market data.4MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that lets you talk to your AI trading assistant in plain English to research stocks, generate trade recommendations, manage a portfolio, and execute trades through natural language.MIT
- AlicenseAqualityDmaintenanceAn MCP server that wraps the Trading 212 Public API, enabling AI agents to interact with your Trading 212 brokerage account through natural language.16MIT