Skip to main content
Glama

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

Target Sell Price

workflow.run_target_sell_price
Read-only

The sell price that makes a target ROI or a target profit on a spot trade after both fees: the inverse of workflow.run_crypto_profit. Give exactly one of targetRoiPct (a fraction, 0.25 = 25%, negative for a stop price, above -1) or targetProfit (money; needs investment or quantity). Fees are a fraction of each fill's value (0.001 = 0.1%): the buy fee on top of the coins' cost, the sell fee out of the sale value (each fee at most 0.05); prices may be in any currency and results are in the same one; investment is the total cash spent, buy fee included. sellPrice = buyPrice x (1 + buyFee) x (1 + ROI) / (1 - sellFee); a target ROI of 0 is the break-even price. Edge cases: giving both or neither of targetRoiPct and targetProfit is an error; giving both investment and quantity is an error; targetProfit without a size is an error; a target that loses the whole stake or more (ROI of -1 or lower, or cost plus target profit at or below zero) is an error; a negative target gives a stop price below break-even. Not covered: taxes, FIFO/LIFO lots, slippage, withdrawal or network fees, currency conversion, leverage and funding. A target ROI does not depend on the size; with investment or quantity the cost, proceeds, profit and fees are returned too. Use when user asks "at what price do I sell to make 20% after fees?" or "to net $500 on this position, where do I put my limit sell?". Returns: sellPrice, requiredRoiPct (a fraction), priceChangePct, priceMultiple, breakevenSellPrice, and with a size: quantity, totalCost, sellValue, sellFee, proceeds, profit, totalFees (null without one).

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": {
      "buyPrice": "<buyPrice>"
    },
    "name": "workflow.run_target_sell_price"
  }
}

Input Schema

NameRequiredDescriptionDefault
buyPriceYesPrice paid per coin
quantityNoNumber of coins bought. Give this or investment, not both
buyFeePctNoBuy fee as a fraction of the trade value, 0 to 0.05 (0.001 = 0.1%). Default 0
investmentNoTotal cash spent on the buy, buy fee included. Give this or quantity, not both
sellFeePctNoSell fee as a fraction of the trade value, 0 to 0.05. Default 0
targetProfitNoTarget profit in money after both fees (negative for a loss limit). Needs investment or quantity. Give this or targetRoiPct, not both
targetRoiPctNoTarget return as a fraction of the cost (0.25 = 25%), above -1. Give this or targetProfit, not both

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered; the description goes well beyond by disclosing the exact pricing formula, fee treatment (buy fee on top of cost, sell fee off the sale value, capped at 0.05 each), currency invariance, and an explicit 'Not covered' list (taxes, lots, slippage, withdrawal/network fees, conversion, leverage, funding). Those exclusions are the kind of scope boundary an agent cannot infer from structured fields.

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?

Purpose and the inverse-relationship are front-loaded, and nearly every sentence carries unique information. The downside is that the middle is a dense run-on block of formula, edge cases, and exclusions with no visual separation, which makes it harder to scan than it needs to be.

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 seven-parameter financial calculator with no output schema, the description covers inputs, constraints, failure modes, the underlying formula, and the returned fields (sellPrice, breakevenSellPrice, priceChangePct, and the size-dependent cost/proceeds/fees block, noting nulls without a size). Nothing an agent needs in order to call it correctly 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 is 3, but the description adds real meaning: targetRoiPct is a fraction (0.25 = 25%) that must exceed -1 and goes negative for stop prices, targetProfit is money requiring investment or quantity, and investment is defined as total cash spent including the buy fee. It stops short of clarifying edge semantics such as rounding or how quantity is derived from investment, so it is not a full 5.

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 opens with a precise definition: the sell price achieving a target ROI or target profit on a spot trade after both fees, and explicitly positions it as the inverse of workflow.run_crypto_profit. That relational framing lets an agent distinguish it from the large family of sibling workflow.run_* calculators without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete user-phrasing triggers ("at what price do I sell to make 20% after fees?", "to net $500 on this position") and enumerates mutual-exclusion rules: exactly one of targetRoiPct/targetProfit, not both investment and quantity, and targetProfit requires a size. It also lists the invalid-target conditions, so the agent knows when the call will fail rather than guessing.

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.