Skip to main content
Glama
pedrobraiti

mcp-ibkr-agent

by pedrobraiti

close_position

Closes an entire position for a given symbol by sending an opposite order of the exact quantity. If the position is not visible due to eventual consistency, retry after a few seconds.

Instructions

Closes 100% of a symbol's position, trading the exact fractional quantity.

Reads the exact position size and sends the opposite order. Note: IBKR's portfolio is eventually-consistent — right after a recent BUY the position may not appear yet (and the close will return closed=False). In that case, wait a few seconds and try again, or sell the exact quantity via sell.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
Behavior5/5

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

With no annotations, the description fully discloses behavior: it reads position size, sends opposite order, and explains eventual consistency and failure mode (closed=False). This provides excellent transparency.

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 fairly concise with two paragraphs, front-loading the core action. It could be slightly more streamlined, but it efficiently conveys important behavioral notes.

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 a single parameter, no output schema, and no annotations, the description covers the tool's purpose, behavior, edge cases, and alternative usage. It is complete for practical use.

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?

Schema has 0% description coverage. The description mentions 'symbol' implicitly but doesn't add extra detail beyond the schema's required field. For one parameter, more elaboration on format or constraints would improve clarity.

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 100% of a symbol's position' with specific verb and resource. It distinguishes from sibling 'sell' by specifying full closure and exact fractional quantity.

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 gives clear context for use (closing entire position) and mentions the eventual consistency issue and fallback to 'sell'. It could explicitly list when not to use, but the guidance is effective.

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/pedrobraiti/agentic-trading-mcp'

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