Skip to main content
Glama

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

Exit Target

workflow.run_exit_target
Read-only

Calculate the exact exit price needed to hit a target PnL or ROE percentage. Edge cases: entryPrice, leverage and sizeBase above zero; targetMode pnl or roe, targetValue any number; fees 0 to 0.05 (defaults 0.0002 and 0.0005); a target that cannot be reached from this position is an error. Not covered: funding, slippage, liquidation before the target, and the chance that price gets there. Use when user asks "at what price do I take profit to make $500?" or "where should I set TP for 20% ROE?". Returns: targetExitPrice.

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>",
      "entryPrice": "<entryPrice>",
      "leverage": "<leverage>",
      "sizeBase": "<sizeBase>",
      "targetMode": "<targetMode>",
      "targetValue": "<targetValue>"
    },
    "name": "workflow.run_exit_target"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYesTrade direction: "long" or "short"
leverageYesLeverage multiplier
sizeBaseYesPosition size in base asset
entryPriceYesEntry price
feeOpenPctNoOpening fee fraction, default 0.0002
targetModeYes"pnl" = target in USDT, "roe" = target in %
feeClosePctNoClosing fee fraction, default 0.0005
targetValueYesTarget value (USDT/coin for pnl mode, or %)
contractTypeNolinear = USDT-margined (default), inverse = coin-margined. For inverse, pnl-mode targetValue and outputs are 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. Changed2 schema fields changed
    • addedInput schema / properties / contractType
      Added value: +{
      +  "description": "linear = USDT-margined (default), inverse = coin-margined. For inverse, pnl-mode targetValue and outputs are in the base coin.",
      +  "enum": [
      +    "linear",
      +    "inverse"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / targetValue / description
      Previous value: -"Target value (USDT or %)"New value: +"Target value (USDT/coin for pnl mode, or %)"
  3. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, openWorldHint=false, and destructiveHint=false, so safety is settled. The description adds real behavioral context beyond that: input preconditions (entryPrice, leverage, sizeBase above zero), fee ranges with defaults, and the important failure mode that an unreachable target is an error. It also disclaims funding/slippage/liquidation, which prevents over-trusting the result; only minor gaps remain (no precision/rounding or contract-scaling caveats in prose).

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?

Front-loaded with the core purpose, then an edge-case clause, then a not-covered clause, then examples. Every sentence carries information. The semicolon-chained edge-case sentence is dense but scannable; a small deduction for cramming constraints, defaults, and error behavior into one run-on clause.

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 9-parameter read-only calculator with no output schema, the description supplies the return field (targetExitPrice), precondition constraints, fee defaults, error semantics, and explicit scope exclusions. The inverse/linear unit difference is only in the schema text, and fee/target interaction details are absent, but an agent has what it needs to invoke this correctly.

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%, including enum explanations for side, targetMode, and contractType, so the schema carries the parameter burden. The description reinforces the fee defaults (0.0002 and 0.0005) and the pnl/roe target meaning, but adds essentially no semantics beyond the schema for parameters such as contractType's inverse-mode unit behavior.

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?

States a specific verb and resource: 'Calculate the exact exit price needed to hit a target PnL or ROE percentage.' This distinguishes it clearly from siblings like workflow.run_target_sell_price, workflow.run_scale_out, and workflow.run_pnl_planning by naming the target-mode dimensions (pnl vs roe) and the output (targetExitPrice).

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 use cases: 'at what price do I take profit to make $500?' and 'where should I set TP for 20% ROE?', which map directly to the two targetMode values. It also lists edge cases/preconditions and states what is explicitly not covered (funding, slippage, liquidation before the target). It does not name a specific sibling as an alternative, so it falls short of 5.

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.