Skip to main content
Glama

Close Position

close_position
Destructive

Close an open position on a broker account. Can close the full position or a partial amount. Closing is immediate at market price. WARNING: This executes a real trade on the broker — closing on a "live" account will result in actual realized P&L. Closing or modifying positions does not consume daily credits.

Input Schema

NameRequiredDescriptionDefault
qtyNoQuantity in lots to close. Omit or 0 for full close
positionIdYesThe position ID (from get_positions)
brokerAccountIdYesThe broker account ID (from get_positions)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, openWorldHint=true and non-idempotency, but the description goes well beyond them: execution is immediate at market price, on a live account it produces real realized P&L, and closing/modifying consumes no daily credits. That is exactly the kind of consequence and cost context an agent needs before a write.

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?

Purpose is front-loaded in the first sentence, followed by scope, execution semantics, and a clearly marked WARNING. Every sentence carries distinct, actionable information with no filler.

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?

For a destructive mutation with no output schema, the definition covers safety, execution model and cost implications thoroughly. It stops short of describing what the call returns (e.g., realized P&L or fill confirmation), which is the only meaningful gap.

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 coverage is 100%, so positionId, brokerAccountId and qty are already documented in the schema, including the omit/0 semantics for qty. The description only restates full-vs-partial at a high level, adding no syntax or format detail beyond the schema.

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?

States a specific verb+resource ('Close an open position on a broker account') and immediately scopes the operation ('full position or a partial amount'). An agent can distinguish it from modify_position and cancel_broker_order without opening a schema.

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?

Gives clear context for when to use it (closing an open position, full or partial) and implicitly contrasts with 'modifying positions'. However, it never names an explicit alternative (e.g., modify_position for adjustments, cancel_broker_order for pending orders) or states when-not to use it.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources