Skip to main content
Glama
multi-exchange-spread

multi-exchange-spread

by tordagaz-ops

Size a trade against real books

estimate_trade
Read-only

Estimates executable cross-exchange spread profit by walking two venues' order books for a dollar amount, reporting VWAPs, gross and net profit after fees, and the largest size that still clears fees.

Instructions

Walks the ask side of one venue and the bid side of another to fill a given dollar amount, then reports both VWAPs, the gross profit, both fees, the net profit, and the largest size that still clears the fees. This is the tool that decides whether a scan row is real. Example: symbol='BTC/USDT', notional_usd=25000.

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": {
      "symbol": "<symbol>"
    },
    "name": "estimate_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
symbolYesPair in any spelling: 'BTC/USDT', 'BTCUSDT' or 'btc-usdt'.
venuesNoRestrict the venues: bybit, binance, okx, bitget, kucoin, mexc, gate. Omit to use all seven.
fee_bpsNoTaker fee in basis points, per side. A round trip costs twice this. Default 10 (0.10%), the usual spot taker fee; use your own.
buy_venueNoVenue to buy on. Omit to let the server pick the cheapest ask from the real books.
sell_venueNoVenue to sell on. Omit to let the server pick the richest bid.
notional_usdNoDollar amount to trade on each leg. Default 10000.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, and the description correctly reinforces that this is an estimate against real books rather than an execution. It adds useful detail about simulated fill behavior (walking book depth per leg) and the round-trip fee logic, but says nothing about latency, rate limits, or what happens when book depth is insufficient to fill the requested size.

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?

Three sentences, front-loaded with the core mechanism before the outputs and the example. The output enumeration duplicates what the output schema already carries, which is the only wasted weight.

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 an output schema and read-only annotations in place, the definition covers enough for correct invocation: what it simulates, how fees apply, and how default venue selection works. The remaining gap is edge-case behavior (thin books, partial fills) which an agent pricing a non-trivial notional would want.

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 baseline applies; the schema already documents symbol spellings, venue lists, per-side fee_bps, and per-leg notional. The description's worked example (symbol='BTC/USDT', notional_usd=25000) is a small convenience but adds no semantic meaning beyond the schema.

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 concrete action (walk the ask side of one venue against the bid side of another to fill a dollar amount) and enumerates exactly what it returns: both VWAPs, gross profit, both fees, net profit, and max clearing size. The line 'This is the tool that decides whether a scan row is real' positions it relative to the scanning siblings without ambiguity.

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 only implied: the 'decides whether a scan row is real' framing suggests it follows a scan, but no sibling is named and no when-not condition is given. It never says, for example, to use get_spread for a quick two-venue quote instead of a full fill simulation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools