Skip to main content
Glama
Public.com MCP Server

Public.com MCP Server

Official
by PublicDotCom

flatten_and_go_short

Destructive

Sell any existing long position in a symbol, then place a short-sale order; skip the flatten step if no long position exists, noting the two orders are not atomic.

Instructions

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.

If no long position exists the flatten step is skipped and only the short order is placed.

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.

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>",
      "short_quantity": "<short_quantity>"
    },
    "name": "flatten_and_go_short"
  }
}

Input Schema

NameRequiredDescriptionDefault
symbolYes
account_idNo
order_typeNoMARKET
stop_priceNo
limit_priceNo
time_in_forceNoDAY
short_quantityYes
expiration_timeNo
flatten_timeoutNo
equity_market_sessionNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: it is flagged experimental, non-atomic across two real orders, subject to price movement between fill and entry, and parameterized by a flatten_timeout (default 60s) with described skip semantics. Annotations declare destructive/openWorld/non-idempotent, and the description's warning reinforces rather than contradicts them.

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-loads the action and the experimental/non-atomic warning before the Args block, so risk is seen first. The Args list is long but each line earns its place given 0% schema coverage; only minor trimming is possible.

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 a 10-parameter destructive trading workflow, the description covers the two-order sequencing, skip behavior, timeout, order-type/price dependencies and account resolution; return values are covered by the output schema, so nothing an agent needs to invoke it safely is missing.

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 full burden and does: every one of the 10 parameters is named with meaning, enum values (MARKET, LIMIT, STOP, STOP_LIMIT, MARKET_ON_CLOSE, LIMIT_ON_CLOSE; DAY/GTD; CORE/EXTENDED), defaults, and conditional requirements (limit_price for LIMIT/STOP_LIMIT/LIMIT_ON_CLOSE, stop_price for STOP/STOP_LIMIT, expiration_time for GTD, ISO 8601 format, account_id fallback to PUBLIC_COM_ACCOUNT_ID). This is exactly what the missing schema descriptions need.

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 two-step verb sequence (sell existing long, then place short) on a named resource (symbol position). It is clearly distinguishable from sibling place_short_order and place_order because it names the flatten-then-short workflow explicitly.

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

Usage Guidelines4/5

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

Explains the key conditional path: if no long position exists the flatten step is skipped and only the short is placed, so the agent knows the tool is safe to call in both states. It stops short of naming place_short_order or preflight_short_order as the alternatives when a pure short entry (without flattening) is wanted.

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