Skip to main content
Glama

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

Crypto Profit

workflow.run_crypto_profit
Read-only

Profit or loss on a spot crypto trade (coins bought and sold outright, no leverage, no funding) after both fees. Give exactly one of investment (total cash spent, buy fee included) or quantity (coins bought). Each fee is a fraction of that fill's trade value (0.001 = 0.1%): the buy fee is paid on top of the coins' cost, the sell fee comes out of the sale value. For a leveraged perpetual futures position see workflow.run_pnl_planning. Edge cases: buyPrice and sellPrice above zero; give exactly one of investment (above zero, buy fee included) or quantity (above zero); buyFeePct and sellFeePct are fractions from 0 to 0.05 (default 0); holdingDays optional, annualized return only from 30 days. Spot only. Not covered: taxes, withdrawal and network fees, slippage, price moves in the quote currency, and leveraged positions (use workflow.run_pnl_planning). Use when user asks "I bought BTC at $X, what is my profit if I sell at $Y?" or "what price do I need to sell at to break even after fees?". Returns: quantity, totalCost, proceeds, totalFees, profit, roiPct and priceChangePct (fractions), priceMultiple, breakevenSellPrice, annualizedReturnPct (a fraction, only when holdingDays is given and is at least 30, null otherwise: annualizing a shorter hold gives meaningless figures).

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>",
      "sellPrice": "<sellPrice>"
    },
    "name": "workflow.run_crypto_profit"
  }
}

Input Schema

NameRequiredDescriptionDefault
buyPriceYesPrice paid per coin, in the quote currency (e.g. 60000 for BTC in USD)
quantityNoNumber of coins bought (e.g. 0.5). 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
sellPriceYesPrice per coin at the sale, or the price to test, same currency
investmentNoTotal cash spent on the buy, buy fee included (e.g. 1000). Give this or quantity, not both
sellFeePctNoSell fee as a fraction of the trade value, 0 to 0.05 (0.001 = 0.1%). Default 0
holdingDaysNoOptional: days the coins were held; 30 or more also returns the annualized return

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / holdingDays / description
      Previous value: -"Optional: days the coins were held, to also return the annualized return"New value: +"Optional: days the coins were held; 30 or more also returns the annualized return"
  2. 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, destructiveHint=false and openWorldHint=false, so safety is covered; the description then adds real behavioral context beyond them: the fee mechanics per fill, the 0–0.05 fraction bounds, the annualization floor at 30 days with the reason ("annualizing a shorter hold gives meaningless figures"), and the full set of returned fields. Nothing about the computation's semantics is left implicit.

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 computation, then organized into edge cases, exclusions, trigger examples, and returns — good scanning structure. It loses a point for duplication: the investment/quantity exclusivity and the pointer to workflow.run_pnl_planning are each stated twice, which inflates an already dense block.

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?

Despite seven parameters and no output schema, the description enumerates every returned value (quantity, totalCost, proceeds, totalFees, profit, roiPct, priceChangePct, priceMultiple, breakevenSellPrice, annualizedReturnPct) including the conditional null case. An agent has everything needed to call it and interpret the result without further inspection.

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 genuinely adds meaning: it clarifies that investment is inclusive of the buy fee, that the buy fee is paid on top of the coins' cost while the sell fee comes out of the sale value, and that exactly one of investment/quantity must be supplied. These distinctions are only partly captured by the schema field descriptions.

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 computation (profit/loss after both fees) on a specific resource (spot crypto trade, coins bought and sold outright, no leverage, no funding). It explicitly excludes leveraged perpetual positions and routes those to workflow.run_pnl_planning, so the agent can separate it from siblings without opening a 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?

Provides concrete triggering utterances ("I bought BTC at $X, what is my profit if I sell at $Y?" and the break-even phrasing), states the alternative tool for leveraged positions, and lists what is not covered (taxes, withdrawal/network fees, slippage, quote-currency moves, leverage). When-to-use, when-not-to-use, and the alternative are all explicit.

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.