Skip to main content
Glama

Trading cost calculator

calculate_trading_cost
Read-onlyIdempotent

The cost of one round trip (commissions, bid-ask spread, slippage) in USD, in R, as a share of the target move and of the position, and over a year of trades. Computed with the same function as Clear Tape's free trading cost calculator page (linked in the result), not estimated. Returns the inputs, each result with its unit, the formula and the page link. Educational, not investment advice.

Input Schema

NameRequiredDescriptionDefault
langNoLanguage of the returned text: "en" (default) or "zh" (Simplified Chinese).en
stopYesStop price per share in USD; not equal to the entry.
entryYesEntry price per share in USD.
sharesYesNumber of shares.
spreadYesBid-ask spread per share in USD (paid once per round trip, half on each side).
targetNoOptional: target price per share in USD, on the other side of the entry from the stop.
tradesNoOptional: round trips per year, for the annual cost.
slippageYesSlippage per share per side in USD.
commissionYesCommission per order (each side) in USD; 0 if none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world behavior, so the description is freed to add value — and it does: results are deterministic (same function as the public calculator page, 'not estimated'), the page link is embedded in the result, and the response includes inputs, per-result units and the formula. The disclaimer further sets expectations.

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?

Four sentences, front-loaded with what is computed, then provenance, then the return shape, then the disclaimer — no filler. The disclaimer sentence is mild boilerplate but earns its place for a financial-adjacent tool.

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?

With no output schema, the description steps in well by enumerating what comes back (inputs, each result with its unit, the formula, the page link). Combined with full parameter documentation and safety annotations, an agent has enough to call and interpret it; only error/edge-case behavior (e.g. stop equal to entry) is left unaddressed.

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%, so the schema already documents every parameter including defaults, bounds and per-side vs per-order semantics. The description only loosely echoes the inputs ('commissions, bid-ask spread, slippage') without adding format or interpretation detail, so the baseline 3 applies.

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 precise computation — the round-trip cost of a trade broken into commissions, bid-ask spread and slippage — and gives result units (USD, R multiple, share of target move, share of position, annualized). This is a distinct resource among the sibling calculators (position size, Kelly, drawdown), so an agent can disambiguate 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 Guidelines3/5

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

Usage is implied rather than stated: the tool is for estimating the all-in cost of a trade, and the closing note frames it as educational rather than investment advice. There is no explicit when-to-use/when-not guidance or routing to sibling calculators such as calculate_risk_reward or calculate_expectancy.

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.

Resources