Skip to main content
Glama

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

Scale Out

workflow.run_scale_out
Read-only

Scale-out planner: P&L, ROI, and cumulative P&L for each partial exit level. Edge cases: entry_price and total_size above zero; 2 to 10 exits, each price above zero and pct above 0 and at most 100, the pct values summing to at most 100 (less than 100 leaves the rest open); fees are fractions from 0 to 0.05. Not covered: the remainder not sold, funding, slippage, and the chance that each level is reached. Use when user wants to take profit at multiple targets: "close 30% at $90k, 30% at $95k, 40% at $100k, what's my total P&L?". Returns: per-level pnl, weightedAvgExitPrice, totalRoi.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "side": "<side>",
      "entry_price": "<entry_price>",
      "total_size": "<total_size>",
      "exits": "<exits>"
    },
    "name": "workflow.run_scale_out"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYesTrade direction: "long" or "short"
exitsYesPartial exit levels (2 to 10). Each: { price, pct }, e.g. [{ "price": 90000, "pct": 30 }, { "price": 95000, "pct": 70 }]; the pct values must not sum to more than 100.
total_sizeYesTotal position size in base currency
entry_priceYesEntry price
contractTypeNolinear = USDT-margined (default), inverse = coin-margined. total_size is USD notional (contracts) for inverse, and per-level pnl comes back denominated in the base coin.
fee_open_pctNoOpen fee rate (default 0.0002)
fee_close_pctNoClose fee rate (default 0.0005)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / exits / description
      Added value: +"Partial exit levels (2 to 10). Each: { price, pct }, e.g. [{ \"price\": 90000, \"pct\": 30 }, { \"price\": 95000, \"pct\": 70 }]; the pct values must not sum to more than 100."
    • addedInput schema / properties / exits / items / properties / price / description
      Added value: +"Exit price for this level"
    • 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. total_size is USD notional (contracts) for inverse, and per-level pnl comes back denominated in the base coin.",
      +  "enum": [
      +    "linear",
      +    "inverse"
      +  ],
      +  "type": "string"
      +}
  3. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already cover the safety profile (read-only, non-destructive, closed-world), and the description adds substantial context beyond them: hard validation bounds (entry_price and total_size above zero, 2–10 exits, fee fractions 0–0.05) and an explicit non-coverage list (unsold remainder, funding, slippage, probability of each level being reached). Since there is no output schema, the closing "Returns: per-level pnl, weightedAvgExitPrice, totalRoi" is real added information rather than duplication.

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?

Dense and nearly waste-free: purpose, computed fields, constraints, exclusions, trigger example, and return shape, each in a single clause. Minor structural cost is that the intent-matching trigger and the returns list sit after the compressed edge-case block, so the most decision-relevant sentence is not maximally front-loaded.

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 7-parameter read-only calculator with no output schema, the definition covers purpose, valid input ranges, known modeling gaps, and the returned field names — enough for an agent to call it correctly and describe its limits. Nothing material an agent would need is missing.

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 would be 3; the description earns above that by supplying semantic constraints the schema states only partially — the pct values summing to at most 100 and, importantly, that less than 100 leaves the remainder open, plus the 0-to-0.05 fee range. It does not elaborate on contractType or any inverse-specific denomination nuance, but the schema carries that.

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?

Names a specific verb-plus-resource ("Scale-out planner") and enumerates the computed outputs (P&L, ROI, cumulative P&L per partial exit level), so an agent knows exactly what it produces. It never distinguishes itself by name from near neighbors like run_exit_target, run_target_sell_price, run_ladder_max_leg, or run_pnl_planning, leaving the agent to infer differentiation from phrasing alone.

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 a clear trigger condition ("Use when user wants to take profit at multiple targets") reinforced by a literal sample utterance, which is exactly the pattern an agent needs to match intent. It stops short of exclusions — no statement of when a single-target or ladder-max-leg tool is the better choice instead.

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.