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.7/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, requires account linkage, has no crypto-6 restriction, automatically determines real/virtual positions, and reports execution_mode as 'mixed' if both exist. Also explains the not-found behavior in detail.

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 dense yet well-organized, front-loaded with the tool's category (Axis③) and priority. Every sentence adds value: comparisons, behavior, edge cases, and safety notes are all included without redundancy.

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 the tool's complexity and absence of an output schema, the description covers all necessary contexts: what happens with real vs virtual positions, mixed execution, no-position case, and safety for speculative calls. It is complete for an AI agent to select and invoke it correctly.

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 baseline is 3. The description adds contextual meaning like 'any symbol you actually hold' and 'partially reduces' but does not elaborate on the schema's parameter descriptions beyond what is already provided. The schema already contains examples and defaults.

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 tool closes or partially reduces an existing position through DECKER's own execution engine. It distinguishes itself from the sibling 'decker.place_order' by explicitly contrasting with it, making the purpose unambiguous.

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?

It explicitly references decker.place_order as an alternative and explains when to use this tool: 'Unlike place_order, there is no crypto-6 restriction.' It also provides a when-not condition: 'No open position for the symbol = a clean not-found response, not an error — safe to call speculatively.'

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.3/5.0
Disambiguation3/5

Execution and settings tools are clearly separated, but there is a dense cluster of analytical getters (get_view, get_reading, get_signals, get_assembly) that all return market verdicts and coordinates; their boundaries are only clear after reading the long descriptions. get_market_state versus get_state_timeline is cleaner, but the overlap among the analysis-verdict tools could still cause misselection.

Naming Consistency5/5

All tools share the decker_ prefix and a consistent snake_case verb_noun pattern (get_* for reads, place_order/close_position/update_protective_stops/set_skill_overlay/validate_intent for actions). There is no mixing of naming conventions or vague generic verbs.

Tool Count5/5

Thirteen tools is within the ideal well-scoped range for an execution-plus-analysis server. Each tool maps to a distinct responsibility (state reading, timeline history, signals, execution, position management, user settings, pre-trade validation), so none feels like filler.

Completeness4/5

The lifecycle is well covered: validate_intent → place_order → get_positions → update_protective_stops → close_position, with signal/analysis and skill-overlay tools around it. Minor gaps like a dedicated account-balance or full order-history tool are absent, but the execution engine handles caps server-side and closed round-trips are included in get_positions.