Skip to main content
Glama
alpacahq

alpaca-mcp-server

Official
by alpacahq

close_position

Close a specific trading position by placing a sell order for a symbol. The order executes immediately during market hours or queues for the next market open.

Instructions

Closes a specific position for a single symbol by placing a sell order. If the market is closed, the sell order will remain queued and execute at the next market open.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qtyNothe number of shares to liquidate. Can accept up to 9 decimal points. Cannot work with percentage
percentageNopercentage of position to liquidate. Must be between 0 and 100. Would only sell fractional if position is originally fractional. Can accept up to 9 decimal points. Cannot work with qty
symbol_or_asset_idYessymbol or assetId

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 the full burden and adds valuable behavioral context beyond the input schema: it explains that the sell order queues if the market is closed and executes at the next open, which is critical for understanding timing and execution behavior. It does not cover aspects like authentication needs or rate limits, but the disclosed behavior is substantial.

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?

The description is front-loaded with the core action in the first sentence and adds important behavioral context in the second, with zero wasted words. Every sentence earns its place by providing essential information without redundancy or fluff.

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?

Given the complexity of a financial trading tool with no annotations but a 100% schema coverage and an output schema (implied by context signals), the description is mostly complete: it explains the tool's purpose, usage context, and key behavioral trait (queuing on market closure). However, it lacks details on prerequisites like authentication or error handling, which could be important for full context.

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

Parameters3/5

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

The schema description coverage is 100%, so the input schema fully documents the parameters (qty, percentage, symbol_or_asset_id). The description does not add any parameter-specific details beyond what the schema provides, such as clarifying the interaction between qty and percentage, so it meets the baseline of 3 without compensating further.

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 action ('Closes a specific position'), the resource ('for a single symbol'), and the mechanism ('by placing a sell order'), distinguishing it from sibling tools like 'close_all_positions' which handles multiple positions. It specifies a precise operation rather than a generic close.

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 for when to use it (closing a single position) and hints at alternatives by specifying 'for a single symbol,' implying 'close_all_positions' for multiple symbols. However, it does not explicitly state when not to use it or name alternatives, leaving some ambiguity about sibling tools like 'do_not_exercise_options_position'.

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