Skip to main content
Glama

Close Positions

close_positions
Destructive

Close open positions on a Connections account (all asset classes). Omit symbol to flatten (confirm_close_all=true if multiple). May return pending_confirmation when HITL is on.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sideNoOptional; required when multiple sides (long/short or yes/no) exist for the symbol.
symbolNoOptional — omit to close all positions on the account.
quantityNoOptional partial close; omit for full position. Requires symbol.
broker_account_idNoInteger id from list_brokers. Required when more than one enabled account exists.
confirm_close_allNoRequired true when closing more than one position. Show positions_to_close from a prior response first.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
messageNo
successNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedOutput schema / description
      Previous value: -"Structured Gogi result. Error responses include error and message fields."New value: +"Structured result. Error responses include error and message."
    • addedOutput schema / properties
      Added value: +{
      +  "error": {
      +    "type": "string"
      +  },
      +  "message": {
      +    "type": "string"
      +  },
      +  "success": {
      +    "type": "boolean"
      +  }
      +}
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "description": "Structured Gogi result. Error responses include error and message fields.",
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true. Beyond that, the description discloses the HITL flow ('May return pending_confirmation when HITL is on') and the flatten-all semantics of omitting symbol, which are genuine behavioral facts not present in structured data. It could say more about irreversibility or broker auth requirements.

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?

Three compact sentences, no redundancy, with the primary action and the flatten behavior front-loaded before the edge-case HITL note.

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?

Output schema exists so return values needn't be documented, yet the description still flags the pending_confirmation response shape and the confirm_close_all prerequisite, covering what an agent needs to invoke this destructive tool safely.

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 the schema already documents all five parameters, and the description largely restates them (omit symbol, confirm_close_all when multiple, side for multiple sides). Baseline 3 applies since the description adds little parameter 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 ('Close') and resource ('open positions') plus scope ('Connections account, all asset classes'), which cleanly separates it from the read-only sibling get_positions and from cancel_pending_trade.

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 explicit conditional usage: omit symbol to flatten, confirm_close_all=true when multiple positions, side required when multiple sides exist. It doesn't name an alternative tool to use instead, so it stops short of full when/when-not routing.

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