Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

Position Sizing

workflow.run_position_sizing
Read-only

Calculate the correct position size given a maximum risk in USDT and a stop-loss price. Use when user asks "how many coins should I buy?" or "size my position so I risk exactly $X". Returns: positionSize (base), positionUsdt, marginRequired.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sideYes
leverageNoLeverage, default 1
riskUsdtYesMaximum acceptable loss in USDT
stopLossYesStop-loss price
entryPriceYesEntry price
feeOpenPctNoOpening fee fraction, default 0.0002
feeClosePctNoClosing fee fraction, default 0.0005
contractTypeNolinear = USDT-margined (default), inverse = coin-margined. For inverse, sizeQuote is USD contracts and margin is returned in the base coin.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / contractType
      Added value: +{
      +  "description": "linear = USDT-margined (default), inverse = coin-margined. For inverse, sizeQuote is USD contracts and margin is returned in the base coin.",
      +  "enum": [
      +    "linear",
      +    "inverse"
      +  ],
      +  "type": "string"
      +}
  2. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered and the bar is lower. The description adds value annotations do not carry by naming the return shape (positionSize, positionUsdt, marginRequired), which is meaningful because there is no output schema. It omits edge-case behavior (e.g. zero risk distance, fee handling) but that is a minor gap given the annotation coverage.

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?

Three tight sentences with the core calculation front-loaded, then the usage triggers, then the returns. Nothing is wasted, though the return list could be trimmed or the trigger quotes consolidated without loss.

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 stateless calculation tool with 4 required params, an 88%-documented schema and no output schema, the description supplies the missing return contract and the invocation triggers. Edge-case and inverse-contract behavior are left to the schema, which is acceptable but leaves a small gap.

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 88%, so the schema already documents entryPrice, stopLoss, riskUsdt, fees, leverage and contractType. The description only paraphrases riskUsdt and stopLoss, adding no syntax, units or constraint detail beyond what is already structured — baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (calculate) plus the resource (position size) and the two driving inputs (max risk in USDT, stop-loss price). An agent can identify the operation immediately, though it never names a sibling such as run_kelly_frontier or run_forex_position_size_live to disambiguate among the many sizing/risk tools.

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 user-intent triggers ("how many coins should I buy?", "size my position so I risk exactly $X"), which is strong positive routing guidance. It stops short of stating when NOT to use it or which alternative to pick when the user is sizing by a different objective (e.g. Kelly or risk-parity).

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.