Skip to main content
Glama

Market Spread

market_spread
Read-only

Cross-exchange crypto spread from live tickers: gross spread, fees, modelled slippage, transfer cost and net edge in bps for a given trade size. Ticker/volume based (no full order book). Pay per call with USDC or USDT on Base via x402 – no API key, no signup. 3 free calls per wallet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetYesTicker, e.g. ETH.
quoteNoQuote currency (default USDT).USDT
walletNoYour EVM wallet address (0x...). Unlocks the free tier (3 free calls per wallet).
api_keyNoOptional AMR enterprise API key.
size_usdNoNotional size in USD (default 1000).
buy_venueYesVenue to buy on, e.g. binance.
x_paymentNoOptional signed x402 payment payload (base64 JSON) for USDC/USDT on Base.
sell_venueYesVenue to sell on, e.g. coinbase.
max_age_secondsNoMax quote age (default 30).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetYes
quoteYes
tokenNoToken actually used for payment (USDC, USDT or FREE).USDC
routingYesHow the request was routed (provider, fallback, cache, latency).
fees_bpsYes
buy_priceYes
buy_venueYes
cost_usdcYesPrice charged in stablecoin units (USDC/USDT 1:1); 0 on the free tier.
confidenceYes
fetched_atNoUTC timestamp when the data was fetched.
sell_priceYes
sell_venueYes
slippage_bpsYes
transfer_costYesAbsolute transfer/gas cost in quote units.
execution_riskYes
net_spread_bpsYes
gross_spread_bpsYes
freshness_secondsYesAge of the underlying data in seconds (0 = fetched live).
transfer_cost_bpsYes
x_payment_responseNoBase64-encoded x402 settlement receipt (mirrors the X-PAYMENT-RESPONSE header). Only present when the call was paid with `x_payment`.
estimated_net_profit_usdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "Response for ``POST /market-spread``.",
      +  "properties": {
      +    "asset": {
      +      "title": "Asset",
      +      "type": "string"
      +    },
      +    "buy_price": {
      +      "title": "Buy Price",
      +      "type": "number"
      +    },
      +    "buy_venue": {
      +      "title": "Buy Venue",
      +      "type": "string"
      +    },
      +    "confidence": {
      +      "maximum": 1,
      +      "minimum": 0,
      +      "title": "Confidence",
      +      "type": "number"
      +    },
      +    "cost_usdc": {
      +      "description": "Price charged in stablecoin units (USDC/USDT 1:1); 0 on the free tier.",
      +      "title": "Cost Usdc",
      +      "type": "number"
      +    },
      +    "estimated_net_profit_usd": {
      +      "title": "Estimated Net Profit Usd",
      +      "type": "number"
      +    },
      +    "execution_risk": {
      +      "enum": [
      +        "low",
      +        "medium",
      +        "high"
      +      ],
      +      "title": "Execution Risk",
      +      "type": "string"
      +    },
      +    "fees_bps": {
      +      "title": "Fees Bps",
      +      "type": "number"
      +    },
      +    "fetched_at": {
      +      "description": "UTC timestamp when the data was fetched.",
      +      "format": "date-time",
      +      "title": "Fetched At",
      +      "type": "string"
      +    },
      +    "freshness_seconds": {
      +      "description": "Age of the underlying data in seconds (0 = fetched live).",
      +      "title": "Freshness Seconds",
      +      "type": "integer"
      +    },
      +    "gross_spread_bps": {
      +      "title": "Gross Spread Bps",
      +      "type": "number"
      +    },
      +    "net_spread_bps": {
      +      "title": "Net Spread Bps",
      +      "type": "number"
      +    },
      +    "quote": {
      +      "title": "Quote",
      +      "type": "string"
      +    },
      +    "routing": {
      +      "description": "How the request was routed (provider, fallback, cache, latency).",
      +      "properties": {
      +        "cache_hit": {
      +          "default": false,
      +          "description": "True if the result was served from cache.",
      +          "title": "Cache Hit",
      +          "type": "boolean"
      +        },
      +        "fallback_used": {
      +          "default": false,
      +          "description": "True if the primary provider failed and a fallback served the result.",
      +          "title": "Fallback Used",
      +          "type": "boolean"
      +        },
      +        "latency_ms": {
      +          "default": 0,
      +          "description": "End-to-end routing latency in milliseconds.",
      +          "title": "Latency Ms",
      +          "type": "integer"
      +        },
      +        "provider": {
      +          "description": "Name of the upstream provider that served the result.",
      +          "title": "Provider",
      +          "type": "string"
      +        },
      +        "providers_tried": {
      +          "description": "Providers attempted, in order.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "title": "Providers Tried",
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "provider"
      +      ],
      +      "title": "RoutingMeta",
      +      "type": "object"
      +    },
      +    "sell_price": {
      +      "title": "Sell Price",
      +      "type": "number"
      +    },
      +    "sell_venue": {
      +      "title": "Sell Venue",
      +      "type": "string"
      +    },
      +    "slippage_bps": {
      +      "title": "Slippage Bps",
      +      "type": "number"
      +    },
      +    "token": {
      +      "default": "USDC",
      +      "description": "Token actually used for payment (USDC, USDT or FREE).",
      +      "title": "Token",
      +      "type": "string"
      +    },
      +    "transfer_cost": {
      +      "description": "Absolute transfer/gas cost in quote units.",
      +      "title": "Transfer Cost",
      +      "type": "number"
      +    },
      +    "transfer_cost_bps": {
      +      "title": "Transfer Cost Bps",
      +      "type": "number"
      +    },
      +    "x_payment_response": {
      +      "description": "Base64-encoded x402 settlement receipt (mirrors the X-PAYMENT-RESPONSE header). Only present when the call was paid with `x_payment`.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "asset",
      +    "quote",
      +    "buy_venue",
      +    "sell_venue",
      +    "buy_price",
      +    "sell_price",
      +    "gross_spread_bps",
      +    "fees_bps",
      +    "slippage_bps",
      +    "transfer_cost",
      +    "transfer_cost_bps",
      +    "net_spread_bps",
      +    "estimated_net_profit_usd",
      +    "confidence",
      +    "execution_risk",
      +    "freshness_seconds",
      +    "cost_usdc",
      +    "routing"
      +  ],
      +  "type": "object"
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / max_age_seconds / default
      Added value: +30
    • addedInput schema / properties / quote / default
      Added value: +"USDT"
    • addedInput schema / properties / size_usd / default
      Added value: +1000
    • changedInput schema / properties / wallet / description
      Previous value: -"Your EVM wallet address (0x...). Unlocks the free tier (3 calls per wallet)."New value: +"Your EVM wallet address (0x...). Unlocks the free tier (3 free calls per wallet)."
  3. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnlyHint and openWorldHint annotations, the description discloses the payment model (per-call with USDC/USDT on Base via x402, no API key, 3 free calls per wallet) and the data source limitation (ticker/volume, no full order book). These are important behavioral traits not captured in annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the tool's purpose and outputs, followed by the payment model. Every sentence adds value; no fluff.

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?

The description covers the core purpose, payment model, and data source limitation. Since an output schema exists, return values are covered elsewhere. It doesn't explicitly mention the required parameters or the default quote, but these are in the schema. Overall, it provides sufficient context for an agent to decide whether to use it, though it could mention the free-tier wallet requirement explicitly (though it's in schema).

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?

The schema covers all parameters with descriptions, so the baseline is 3. The description doesn't add additional meaning beyond what's in the schema; it merely refers to 'given trade size' which aligns with size_usd. No extra semantic guidance is provided.

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?

Clearly states it computes cross-exchange crypto spread from live tickers, listing specific outputs (gross spread, fees, slippage, transfer cost, net edge in bps) and the trade size input. It also specifies it's ticker/volume based, not full order book, distinguishing it from potential siblings like dex_price or token_price.

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?

Provides clear context that this is for cross-exchange spread analysis and notes the limitation of being ticker/volume based (no full order book), which helps an agent decide when to use it. However, it doesn't explicitly name alternative tools or state when not to use it.

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.