Skip to main content
Glama
tedorigawa001

TradingView-MCP

compute_position_size

Calculate a risk-budgeted instrument quantity from entry, stop, execution costs, and currency constraints, rounding down and failing safely when data is missing. Does not access accounts or place orders.

Instructions

Compute a risk-budgeted instrument quantity from entry, stop, explicit execution cost, quantity constraints, and fresh quote-to-account currency evidence. The quantity is always rounded down and the tool fails closed when conversion evidence or minimum-size capacity is missing. It does not access an account or place an order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
stop_priceYes
entry_priceYes
risk_amountNo
risk_percentNo
quantity_stepYes
account_equityYes
account_currencyYes
maximum_quantityNo
minimum_quantityYes
conversion_symbolNo
contract_multiplierNo
quote_to_account_rateNoAccount-currency units per one quote-currency unit
conversion_observed_atNo
max_conversion_age_secondsNo
round_trip_cost_price_per_unitNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.10

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so thoroughly: quantity 'is always rounded down,' the tool 'fails closed when conversion evidence or minimum-size capacity is missing,' and it is side-effect-free regarding accounts/orders. These are precisely the behavioral traits an agent cannot infer from the schema.

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?

Three dense sentences with no filler; the core operation is front-loaded, then deterministic behavior and safety exclusions follow. Every sentence contributes distinct information.

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?

For a 16-parameter calculator with no annotations and no output schema, the description covers the operation, key input classes, fail-closed behavior, and side-effect safety. The main gaps are the missing risk-parameter relationship and precise return payload, which are mitigated by the clear 'instrument quantity' phrasing and self-descriptive parameter names.

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 only 6%, so the description must compensate. It adds useful semantic grouping: 'explicit execution cost,' 'quantity constraints,' and 'fresh quote-to-account currency evidence' map to several optional parameters, and 'risk-budgeted' signals the risk inputs. However, it does not explain the risk_amount/risk_percent choice, contract_multiplier, or which constraints are min/max/step, leaving real invocation ambiguity.

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 a precise operation: 'Compute a risk-budgeted instrument quantity' from a specific set of inputs. It also disambiguates from execution/order tools by stating it 'does not access an account or place an order.' This is a verb+resource statement that separates it from the many compute_* siblings.

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?

It gives clear context: pure pre-trade calculation using entry, stop, cost, constraints, and currency evidence, and explicitly excludes account access/order placement. It does not name a specific sibling alternative or provide a when-not condition beyond that behavioral exclusion, so it falls one step short of explicit routing guidance.

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