Skip to main content
Glama
Public.com MCP Server

Public.com MCP Server

Official
by PublicDotCom

preflight_order

Read-only

Estimate costs, fees, buying power, and margin impact of a potential single-leg trade before placing it; does not place an order.

Instructions

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "symbol": "<symbol>",
      "instrument_type": "<instrument_type>",
      "order_side": "<order_side>",
      "order_type": "<order_type>"
    },
    "name": "preflight_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountNo
symbolYes
quantityNo
account_idNo
order_sideYes
order_typeYes
stop_priceNo
limit_priceNo
time_in_forceNoDAY
expiration_timeNo
instrument_typeYes
open_close_indicatorNo
equity_market_sessionNo
tax_lot_matching_instructionsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.0
    • addedInput schema / properties / tax_lot_matching_instructions
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Tax Lot Matching Instructions"
      +}
  2. First observedv0.3.1

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the read-only, non-destructive, open-world profile, and the description reinforces it while adding real domain context: what the estimate contains, and hard API-enforced constraints on tax_lot_matching_instructions (max 8 lots, SELL equity + CLOSE only, same symbol, quantity must sum, tax-lot data must be refreshed today). It omits latency/refresh characteristics of the estimate, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded: purpose, then returned values, then the not-a-write disclaimer, before the Args block. The length is proportionate to 14 parameters and every line adds information — even the aside about on-close types executing at the closing auction earns its space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists and the description names the main returned figures (commission, fees, order value, buying power, margin impact), so nothing critical is missing for a read-only estimation tool. Only gap is no note on whether the estimate is a point-in-time snapshot that can go stale before placement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% across 14 parameters, so the description carries the full burden and does so thoroughly: value domains for instrument_type, order_side and order_type, conditional requirements for limit_price/stop_price/expiration_time, the quantity-vs-amount mutual exclusion, defaults, and the account_id fallback to PUBLIC_COM_ACCOUNT_ID. This is meaning an agent cannot get from the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Estimate') plus resource ('costs and impact of a potential single-leg trade'), and 'single-leg' scopes it away from the multileg and spread-preflight siblings. The explicit negative 'Does NOT place an order' separates it from place_order at a glance.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Timing is clear — run it before placing the trade — and the 'does NOT place an order' sentence implicitly routes the actual execution to place_order. However, none of the specialized siblings (preflight_multileg_order, preflight_short_order, preflight_buy_event_contract, the spread preflights) are named, so an agent must infer from the input shape which preflight variant applies.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.