Skip to main content
Glama
gaokai258

Fee Optimizer MCP

by gaokai258

get_execution_cost

Read-only

Calculate per-exchange execution costs for crypto orders, including spread, slippage, and depth-walk impact, to compare trading venues by real cost.

Instructions

当用户询问买卖点差、滑点、订单簿深度、大单冲击成本、市价单实际成交成本、各所吃单执行成本对比时使用。Use when the user asks about bid-ask spread, slippage, order-book depth, market impact, or the real execution cost of a marketable order across exchanges. Returns per-exchange one-way execution cost in bps and USD for a specific order size (default $10,000): full spread, crossing cost (half spread), depth-walk slippage beyond the top level, total one-way cost, levels consumed, and fill status. spreadMode=bundled (default) uses offline typical-spread baselines by venue and pair class (majors/large-cap/mid-alt) instantly; spreadMode=live fetches the real top-100 order book per venue independently via ccxt and VWAP-walks it — failures fall back to bundled baselines (listed in failures), shallow books keep the measured cost with a warning. Spot requests use the spot market (e.g. kucoin rather than kucoinfutures). Requires country for compliance filtering unless exchanges are given explicitly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pairNo交易对,默认 BTC/USDT;支持 ETH/USDT、SOL-USDT 等。山寨币点差按内置档位放大(mid-alt ×3),live 模式按真实订单簿
sideNo方向,默认 buy;buy 吃卖盘、sell 吃买盘,live 时两侧深度可能不同
countryNoISO 3166-1 alpha-2 国家代码;传入后按合规可用性过滤交易所(EEA 居民查 USDT 报价对会附稳定币区域可用性警告)
purposeNo市场类型,默认 futures(永续);spot 自动解析各所现货市场与符号
languageNo输出语言:en=英文(默认),zh=中文。仅影响 advice/warnings/tradeoffs/reasons 等叙述性文字,数值、字段名与错误码不受影响
exchangesNo只查询指定交易所(如 ['binance','kraken']);默认返回全部 9 家(合约比较不含 Coinbase)
spreadModeNobundled=内置典型点差基准(默认,秒回、零滑点);live=实时订单簿前100档 VWAP 行走,含真实滑点,单所失败回退 bundled 并记入 failures
tradeSizeUsdNo单笔市价单规模(USD),默认 10000($1万)。滑点对规模高度敏感,大单务必传真实值,如 50000、250000

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.47.1

TDQS

A3.7/5.0
Behavior1/5

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

The description says live mode 'fetches the real top-100 order book per venue independently via ccxt', which is external network access, while the annotations declare openWorldHint=false. That conflicts with the annotation's closed-world claim, so score 1 per the annotation-contradiction rule. The description otherwise adds useful behavioral detail about bundled vs live modes, fallback behavior, and spot-market routing.

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?

The description is front-loaded with usage triggers and then details return metrics and mode behavior in a structured way. It is longer than strictly necessary because the Chinese and English usage sentences duplicate the same trigger, though that duplication may be intentional for bilingual routing.

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?

For an 8-parameter tool with no output schema and only minimal annotations, the description is largely complete: it explains the returned cost components, mode fallbacks, warning behavior, spot-market routing, and the country/exchange interaction. It still does not fully describe every narrative output field implied by the language parameter (advice/warnings/tradeoffs/reasons), leaving a small gap.

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 description coverage is 100%, so the baseline is 3, and the schema already documents each parameter thoroughly. The description adds valuable cross-parameter semantics, especially that country is required for compliance filtering 'unless exchanges are given explicitly', and it clarifies mode-dependent behavior for spreadMode and spot requests.

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 states a specific verb and resource: it returns per-exchange one-way execution cost in bps and USD for a given order size, including spread, crossing cost, slippage, levels consumed, and fill status. It also names explicit user intents (bid-ask spread, slippage, order-book depth, market impact, execution-cost comparison), which lets an agent distinguish this from sibling tools like compare_exchange_fees or get_funding_rates.

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

Usage Guidelines4/5

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

The description has clear trigger conditions: '当用户询问... Use when the user asks about bid-ask spread, slippage...'. It does not, however, name when not to use this tool or explicitly contrast it with the many sibling alternatives (e.g. compare_total_cost, compare_exchange_fees).

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