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

NameRequiredDescriptionDefault
sideYesTrade direction: "long" or "short"
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 / side / description
      Added value: +"Trade direction: \"long\" or \"short\""
  2. 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"
      +}
  3. Added

TDQS

A4/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 safety is covered. The description adds value beyond them by enumerating the three return fields (positionSize, positionUsdt, marginRequired), which matters because no output schema exists. It omits that inverse contracts return margin in the base coin, a behavioral quirk left only to 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 compact sentences: what it computes, when to reach for it, what it returns. The core computation is front-loaded and no sentence is redundant.

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 read-only calculator with no output schema, describing the return fields and the required inputs is sufficient. Minor gaps remain: no note on how leverage/fees/contractType shift the output, and no indication of failure modes (e.g., stopLoss equal to entryPrice).

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 all eight parameters are already documented in the schema. The description only echoes stopLoss and riskUsdt and adds no syntax or interaction detail (e.g., how leverage or the fee fractions influence the result). Baseline 3 applies when the schema carries the semantic load.

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), resource (position size), and the two governing inputs (max risk in USDT, stop-loss price). This clearly separates it from reporting/normalizing siblings like run_forex_pip_value or run_breakeven_planning, though it does not name a specific alternative tool.

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 concrete trigger phrasings ("how many coins should I buy?", "size my position so I risk exactly $X") that map directly to the required params riskUsdt and stopLoss. No when-not conditions or explicit sibling routing are given.

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.