Skip to main content
Glama
alpacahq

alpaca-mcp-server

Official
by alpacahq

close_all_positions

Closes all open trading positions by placing sell orders, with optional cancellation of pending orders before liquidation.

Instructions

Closes all open positions by placing sell orders for each. If the market is closed, the sell orders will remain queued and execute at the next market open.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cancel_ordersNoIf true is specified, cancel all open orders before liquidating all positions.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it explains the market-closed scenario (orders queue for next open) and implies a destructive/write operation through 'closes' and 'sell orders'. It doesn't mention permissions, rate limits, or confirmation requirements, but covers the core execution behavior adequately.

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?

Two sentences with zero waste. The first sentence states the primary action, the second explains a key behavioral nuance. Every word earns its place, and the most important information (what the tool does) is front-loaded.

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 this is a destructive operation with no annotations but with an output schema (which handles return values), the description provides complete context for agent decision-making. It explains the core behavior, distinguishes from siblings, and covers the market timing consideration - all essential for a bulk liquidation tool.

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 description coverage is 100%, so the baseline is 3. The description doesn't mention the 'cancel_orders' parameter at all, but since there's only one optional parameter and the schema fully documents it, this is acceptable. The description focuses on the core action rather than parameter details.

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 the tool's purpose with specific verbs ('closes all open positions', 'placing sell orders') and distinguishes it from siblings like 'close_position' (singular) and 'cancel_all_orders' (cancels orders, not positions). It explicitly defines the resource scope as 'all open positions'.

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 provides clear context about when to use this tool (to close all positions) and implicitly distinguishes it from 'close_position' (for individual positions) and 'cancel_all_orders' (for orders only). However, it doesn't explicitly state when NOT to use it or mention all relevant alternatives like liquidating positions individually.

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/alpacahq/alpaca-mcp-server'

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