Skip to main content
Glama
pbajkovic-hub

tv-cdp-mcp

tv_set_position_brackets

Destructive

Move the stop loss and/or take profit on an open TradingView paper position, leaving unspecified levels unchanged and validating against position side and price.

Instructions

MUTATES the connected TradingView broker: move the stop loss and/or take profit of an OPEN position via the broker adapter (editPositionBrackets). PAPER ONLY - refuses unless the broker is TradingView Paper Trading on a demo account. Give symbol or position_id and at least one of stop_loss / take_profit; the value you leave out keeps its current level (both are always sent). Sanity gate against the position side and price: long needs stop_loss < price < take_profit, short the reverse - no override. Returns previous and applied levels plus the position before/after, read back until the broker shows the new values. dry_run=true returns the plan and sends nothing; use it first. Verified live against a paper position: stop moved and restored, ~450 ms each.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layoutNochart layout id or index; default active
symbolNosymbol of the open position, e.g. BYBIT:ETHUSDT.P (bare ETHUSDT is expanded)
dry_runNotrue = validate against the live position and return the plan without sending
stop_lossNonew stop-loss price
position_idNoposition id from tv_trading_status (wins over symbol; on Paper it equals the symbol)
take_profitNonew take-profit price
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.6/5.0
Behavior5/5

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

Annotations only signal readOnlyHint=false and destructiveHint=true, so the description shoulders the behavioral burden and delivers: paper-only refusal, the no-override sanity gate against position side, the always-send-both-levels behavior, the read-back-until-consistent semantics, and the dry_run sends-nothing behavior. This is rich, non-obvious context an agent cannot infer.

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 core purpose and mutation flag are front-loaded in the opening sentence, followed by crowding conditions, usage constraints, and sanity gate in logical order. The closing 'Verified live... ~450 ms each' is slightly beyond the essential contract, but there is no redundancy or filler elsewhere.

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?

For a destructive mutation with no output schema, the description explains the return shape (previous and applied levels, position before/after, read-back verification), the failure modes (paper-only, sanity gate), and the dry-run path. An agent has everything needed to call this tool correctly on the first attempt, including a safe validation mode.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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, and the description adds genuinely useful cross-parameter semantics that schemas cannot express: 'Give symbol or position_id', 'at least one of stop_loss/take_profit', the omitted-value-keeps-current rule, and the ordering/side sanity gates. It does not narrate each individual parameter, but it doesn't need to given full schema coverage.

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 names the exact operation ('move the stop loss and/or take profit of an OPEN position via the broker adapter (editPositionBrackets)') and the mutation is signaled in the opening word MUTATES. It distinguishes itself from siblings like tv_place_order, tv_close_position, and tv_trading_status by scoping the resource to position stop-loss/take-profit brackets.

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 concrete invocation conditions: PAPER ONLY with a refusal on non-demo brokers, requires symbol or position_id plus at least one of stop_loss/take_profit, and recommends dry_run=true first. It does not explicitly route to alternative siblings or name a when-not condition, so it stops short of a full 5.

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