Skip to main content
Glama

decker.close_position

Axis③ (Order/Execution) — closes (or partially reduces) an existing position through DECKER'S OWN execution engine (see decker.place_order for what that means — same account-linkage requirement applies here for real positions). Unlike place_order, there is no crypto-6 restriction — this reduces risk, not adds it, so any symbol you actually hold (including HL-synthetic/KRX paper positions) can be closed. Mode is NOT chosen by the caller — this looks up whatever position(s) actually exist for the symbol (real via live exchange query, virtual via the paper ledger) and closes whichever are open; if both a real and a virtual position exist for the same symbol, both are closed and the response reports execution_mode as 'mixed'. No open position for the symbol = a clean not-found response, not an error — safe to call speculatively.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYese.g. BTCUSDT, XYZ_GOLDUSD — whatever symbol you hold. Aliases resolve like other tools.
close_fractionNoFraction of the current position to close, 0 < x <= 1. Default 1.0 = full close. E.g. 0.5 closes half.

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description fully discloses behavior: it uses DECKER's execution engine, looks up actual positions (real or virtual), handles mixed positions, and returns a response with execution_mode. It also states the not-found behavior, going beyond what annotations could provide.

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 detailed and every sentence conveys useful information, but it is somewhat verbose with parentheticals and cross-references. It could be tightened slightly without losing the transparency, but it remains well-structured and front-loaded with the primary purpose.

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?

The description covers most aspects: purpose, restrictions, mode selection, mixed positions, and edge cases. The only minor gap is that it doesn't explicitly describe how close_fraction applies when both real and virtual positions exist (e.g., does it close half of each or apply only to one). This is a small ambiguity given the otherwise thorough coverage.

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 input schema provides full descriptions for both parameters (symbol and close_fraction), and the description reiterates that closing can be partial, but adds no new parameter-level details beyond what the schema already states. Given the 100% schema coverage, a baseline score of 3 is appropriate.

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 identifies the action: closes or partially reduces an existing position. It distinguishes itself from sibling tools like place_order by stating it is for closing, not opening, and notes the absence of the crypto-6 restriction. The statement 'No open position for the symbol = a clean not-found response' further clarifies the tool's scope.

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 explains when to use this tool: to close positions, and contrasts it with place_order, noting which restrictions apply. It explicitly says it is safe to call speculatively when no position exists, and mentions the account-linkage requirement for real positions. This is clear, actionable guidance.

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.

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct purpose: state readings (raw vs. view vs. AI-synthesized), signals vs. historical triggers, execution (place/close/update stops), pre-trade validation, and skill management. Cross-references between tools (e.g., get_signals vs. get_trigger_history) explicitly clarify boundaries, leaving no ambiguity about which tool to call.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with the 'decker.' prefix: get_* for reads, place/close/update for actions, set_* for settings, and validate_* for checks. This uniformity makes the tool surface predictable and easy to navigate.

Tool Count5/5

14 tools is well-scoped for a comprehensive trading engine MCP, covering state observation, signal generation, execution, risk management, and user configuration. Each tool earns its place and there are no redundant or missing core functions.

Completeness5/5

The tool surface covers the full trading lifecycle: reading market state (multiple layers), obtaining signals and historical triggers, checking positions, opening/closing positions, updating protective stops, validating intent before orders, and managing skill overlays. The absence of a cancel_order tool is explicitly justified (only market orders), and the domain shows no obvious gaps.

Resources