Skip to main content
Glama
PublicDotCom

Public.com MCP Server

Official
by PublicDotCom

flatten_and_go_short

Sell your current long position in a stock and immediately initiate a short sale in a single workflow.

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
short_quantityYes
order_typeNoMARKET
time_in_forceNoDAY
limit_priceNo
stop_priceNo
expiration_timeNo
equity_market_sessionNo
flatten_timeoutNo
account_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Description adds behavioral context beyond annotations: explains it's experimental, two-order workflow not atomic, both orders execute as real trades, and conditional behavior if no long exists. Annotations only provide readOnlyHint, destructiveHint, idempotentHint, openWorldHint.

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?

Well-structured with summary, warning, conditional note, and parameter list. Front-loaded main purpose. Parameter descriptions are clear but some redundancy with schema defaults. Could be slightly more concise.

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?

Covers workflow, parameters, and important behavioral notes. Does not explain return values, but output schema likely handles that. Missing edge cases like partial fills or error handling, but overall complete for the tool's complexity.

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

Parameters4/5

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

Schema coverage is 0%, but the description includes a detailed Args section explaining each parameter, including conditions like when limit_price is required. Provides meaning beyond schema defaults 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?

Description clearly states the tool sells an existing long position and then places a short sale. It is specific about the two-step workflow and distinguishes from sibling tools like place_short_order which only shorts.

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?

Provides clear context on when to use: to go short after flattening a long. Warns of experimental, non-atomic nature. Implicitly differentiates from place_short_order by mentioning the flatten step, but does not explicitly list alternatives or when not to use.

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