Skip to main content
Glama
PublicDotCom

Public.com MCP Server

Official
by PublicDotCom

search_orders

Read-only

Search an account's last 30 days of order history, including filled, cancelled, rejected, and expired orders, with optional filters for status, symbol, side, and date.

Instructions

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), filledAt, replacedAt, lastModified and equityMarketSession. equityMarketSession reports the session an equity order was placed for as REGULAR, REST_OF_DAY or TWENTY_FOUR_HOURS — a different vocabulary from place_order's equity_market_session argument (CORE / EXTENDED / TWENTY_FOUR_HOURS); never feed one into the other.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sideNo
statusNo
symbolsNo
account_idNo
created_afterNo
security_typeNo
created_beforeNo
open_close_indicatorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly/safe/openWorld, but the description adds substantive behavior: the API-enforced 30-day lookback cap, the 500-order return limit, and a cross-tool vocabulary warning that equityMarketSession (REGULAR/REST_OF_DAY/TWENTY_FOUR_HOURS) is a different enumeration from place_order's equity_market_session (CORE/EXTENDED/TWENTY_FOUR_HOURS) and must never be fed into the other. That mismatch warning is exactly the kind of context annotations cannot provide.

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

Conciseness4/5

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

Front-loaded with purpose, then limits, then result shape, then args — a clean and useful ordering with dense, non-padding prose. Minor deduction because the result-shape paragraph partially repeats what the output schema and get_order already convey, though the cross-tool comparability note keeps it largely earning its place.

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

Completeness5/5

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

For an 8-parameter, 0%-covered search tool this leaves nothing an agent needs unresolved: window and result caps, filter combination semantics, per-parameter formats, and cross-tool enum hazards are all covered, and the output shape is described even though an output schema exists.

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 description coverage is 0%, so the description carries the full burden, and it does: every one of the 8 parameters is documented with allowed values (full status enum, BUY/SELL, security_type list, OPEN/CLOSE applicability), formats and examples (ISO 8601 with a sample timestamp, SYMBOL:TYPE syntax with three examples), and the account_id environment-variable fallback. This is well beyond 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?

The first sentence names a specific verb and resource ('Search the account's order history') plus a concrete scope (last 30 days, any status). It explicitly contrasts itself with get_orders ('returns only the open/active orders embedded in the portfolio snapshot') and with get_order's result shape, so an agent can distinguish it from siblings without opening schemas.

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

Usage Guidelines5/5

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

States exactly when to use it (order-history queries covering filled/cancelled/rejected/expired/replaced orders), names the alternative tool it is not, and clarifies that all filters are optional, combine with AND, and that a no-filter call lists everything in the window. It also tells the agent when to narrow (risk of exceeding 500 results), which is actionable guidance rather than inference.

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