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. 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).

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.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and a closed, non-destructive calculation, so the safety profile is covered. The description adds real behavioral context beyond that: how fees are applied (buy fee on top of cost, sell fee out of proceeds), the mutually exclusive investment/quantity input rule, and the non-obvious annualization rule (only when holdingDays >= 30, otherwise null). It does not discuss rounding or currency assumptions, but the remaining gaps are minor.

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 scope are front-loaded, and the routing/trigger sentences come before the mechanical details. The final sentence packing the full return list is dense and runs long, but every clause carries distinct information (units, conditional null), so little is wasted.

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?

There is no output schema, so the description carries the return-value burden and does so completely — it enumerates every returned field, notes unit conventions (fractions vs percentages), and explains the conditional annualizedReturnPct null case. Combined with the fee and input-exclusivity rules, an agent has everything needed to call and interpret the tool.

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 goes further by explaining the fee semantics in words that clarify what buyFeePct/sellFeePct actually act on (a fraction of that fill's trade value, asymmetric treatment of buy vs sell), and by restating the investment-vs-quantity exclusivity. That adds interpretative value the schema fields alone do not.

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 first sentence names a specific verb and resource — profit or loss on a spot crypto trade — and immediately scopes it ('no leverage, no funding'), which is exactly the boundary that separates it from the many other P&L siblings. It also explicitly routes the leveraged case to workflow.run_pnl_planning, so the agent can distinguish it without opening either 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 explicit when-to-use triggers in the form of verbatim user questions ('I bought BTC at $X, what is my profit if I sell at $Y?') and explicitly names the alternative tool for the leveraged case. Nothing about selection is left to inference.

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.