Skip to main content
Glama
XBTFX

XBTFX MCP Trading Server

by XBTFX

close_by

Destructive

Close two opposing positions against each other to save spread costs on hedging accounts. Use this tool to manage risk by offsetting trades of the same symbol with opposite sides.

Instructions

Close two opposing positions against each other (saves spread on smaller side). Hedging accounts only — check get_auth_status first. Returns 400 on netting accounts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
positionYesFirst position ticket
position_byYesOpposing position ticket (same symbol, opposite side)
commentNoClose-by comment, max 27 ASCII chars
idempotency_keyNoUnique key to prevent duplicate close-by on retry. Auto-generated if omitted.
Behavior4/5

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

The description adds valuable behavioral context beyond annotations: it specifies account type restrictions (hedging vs netting), mentions the error response (400 on netting accounts), and references a prerequisite check (get_auth_status). While annotations already indicate destructiveHint=true and readOnlyHint=false, the description provides operational constraints that aren't captured in structured fields.

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 extremely concise and front-loaded with the most critical information. Every sentence earns its place: the first explains the core action, the second provides critical usage restrictions, and the third gives error behavior. There's zero wasted text or redundancy.

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 destructive nature (destructiveHint=true), lack of output schema, and complexity of closing positions, the description is quite complete. It covers purpose, restrictions, prerequisites, and error conditions. The main gap is not describing the return value format, but with good annotations and clear operational guidance, it's mostly sufficient for agent 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?

With 100% schema description coverage, the baseline is 3. The description doesn't add parameter-specific information beyond what's in the schema descriptions (e.g., it doesn't explain the relationship between position and position_by beyond 'opposing'). However, it does imply that these parameters represent tickets for positions with the same symbol and opposite sides, which is somewhat helpful context.

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 specific action ('close two opposing positions against each other') and resource ('positions'), and distinguishes it from siblings by specifying the unique hedging mechanism ('saves spread on smaller side'). It goes beyond just restating the name to explain the core functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: 'Hedging accounts only — check get_auth_status first' tells when to use (hedging accounts) and includes a prerequisite check. 'Returns 400 on netting accounts' explicitly states when NOT to use (netting accounts), and the sibling tool list includes clear alternatives like close_all, close_position, and close_symbol.

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/XBTFX/xbtfx-mcp-server'

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