Skip to main content
Glama
PublicDotCom

Public.com MCP Server

Official
by PublicDotCom

flatten_and_go_short

Destructive

Liquidates any existing long position in a stock, then opens a short position on the same symbol.

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, or STOP_LIMIT. Default is MARKET. time_in_force: DAY or GTD. Default is DAY. limit_price: Required for LIMIT and STOP_LIMIT 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.

Input Schema

TableJSON 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

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Beyond annotations (destructiveHint=true), the description reveals it's a two-step non-atomic workflow with potential market changes between steps, and that both orders execute as real trades. It also clarifies the skip behavior for missing long positions.

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?

The description is well-structured: a clear purpose statement, a warning paragraph, and a parameter list. It is front-loaded. Some redundancy could be trimmed (e.g., 'Args' header), but overall efficient for a complex tool.

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?

Given the complexity (two-step workflow, 10 params) and presence of an output schema, the description covers the workflow, safety warnings, and parameter roles comprehensively. No gaps identified.

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%, meaning no parameter descriptions in the schema. The description provides meaningful explanations for all 10 parameters (e.g., 'short_quantity: Number of shares to short after flattening'), adding essential context beyond titles and types.

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 description clearly states 'Sell any existing long position in a symbol, then place a short-sale order', which is a specific verb+resource combination. It distinguishes from sibling tools like 'place_short_order' that presumably do not flatten first.

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?

The description explains that if no long position exists, the flatten step is skipped. It warns about the non-atomic experimental nature. However, it does not explicitly state when to use this tool versus alternatives (e.g., 'place_short_order'), though the context implies it.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PublicDotCom/publicdotcom-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server