Skip to main content
Glama
pbajkovic-hub

tv-cdp-mcp

tv_close_position

Destructive

Closes an open TradingView paper trading position by symbol or position ID and returns both the closed position and remaining open positions.

Instructions

MUTATES the connected TradingView broker: close an open position by symbol or position id (market close via the broker adapter). PAPER ONLY. Returns the position that was closed and the remaining open positions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layoutNochart layout id or index; default active
symbolNosymbol of the position to close, e.g. BYBIT:ETHUSDT.P
position_idNoposition id from tv_trading_status (wins over symbol)
expect_layoutNolayout id the tab is expected to show right now; the call refuses if it differs (a tab keeps its target id when the user opens another layout in it)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already mark it destructive and non-read-only, but the description adds significant context: 'MUTATES', 'market close via the broker adapter', 'PAPER ONLY', and the return values (closed position and remaining open positions). This goes well beyond the structured annotations.

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?

A single dense sentence that front-loads the mutation flag, then states the action, selection methods, execution mode, paper-only constraint, and return values. Every clause earns its place with no 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?

Despite no output schema, the description explains return values and covers purpose, mutation, and paper-only constraint. The main gap is that it doesn't explicitly state that at least one of symbol or position_id is required, even though the schema marks both optional.

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 description coverage is 100%, so the baseline is 3. The description mentions 'by symbol or position id' which aligns with the schema, but adds no extra parameter-level detail beyond what the schema already provides.

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 and resource: 'close an open position' on the TradingView broker, with clear selection methods (symbol or position id) and execution mode (market close). This clearly differentiates it from siblings like tv_cancel_order (which cancels orders) and tv_place_order (which places orders).

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?

Provides clear context that this tool is for closing existing positions, not for managing orders or brackets. It doesn't explicitly name alternatives or exclusions, but the action is unambiguous and the 'PAPER ONLY' constraint further narrows when it should be used.

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