Skip to main content
Glama

Trade rail quote

trade_rail_quote

APEX Trade Rail: before a bot buys a token on Arc, X1 or BNB Chain, simulate the buy AND the sell back at its size; a token you could not sell, or whose round trip costs more than maxLossPct (15 at most), is refused with the reason; otherwise the real pool, expected and minimum out, and UNSIGNED transactions for your own wallet (nothing is signed, held or sent by us). $0.003 per call over x402 (USDC on Arc, Base or Solana, or XNT on X1). Call once without payment for the terms, sign them with your own wallet, call again with payment.

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": {
      "chain": "<chain>",
      "token": "<token>",
      "side": "<side>",
      "amount": "<amount>"
    },
    "name": "trade_rail_quote"
  }
}

Input Schema

NameRequiredDescriptionDefault
fromNoyour wallet (needed for the transaction and for sells)
sideYesbuy or sell
chainYesarc, x1 or bnb
tokenYestoken address
amountYesbuy: what you spend (USDC on Arc, XNT on X1, BNB on BNB); sell: tokens
paymentNoa signed x402 payment (the base64 payload you would put in PAYMENT-SIGNATURE). Pass it and the purchase completes inside this tool call.
maxLossPctNo0.5 to 15, default 15

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / maxLossPct / description
      Previous value: -"optional, 0.5 to 15 (default 15)"New value: +"0.5 to 15, default 15"
    • changedInput schema / properties / maxLossPct / type
      Previous value: -"number"New value: +"string"
    • addedInput schema / properties / payment
      Added value: +{
      +  "description": "a signed x402 payment (the base64 payload you would put in PAYMENT-SIGNATURE). Pass it and the purchase completes inside this tool call.",
      +  "type": "string"
      +}
  2. Added

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses that outputs are UNSIGNED transactions, that nothing is signed/held/sent, that refusal comes with a reason, and that pricing is $0.003 per call over x402 with the accepted assets and chains listed. Not covered are idempotency, rate limiting, or what a refusal response looks like structurally.

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?

Front-loads the trigger condition ('before a bot buys a token'), then packs returns, pricing, and the two-step payment flow into a dense but ordered paragraph. Nothing is filler, though the run-on sentence structure makes it slower to scan than it needs to be.

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 a 7-parameter mutating-ish tool with no annotations and no output schema, the description covers the essentials: what comes back, what is refused, cost, and the x402 handshake. It leaves open the exact refusal payload and whether repeated identical calls are safe, which is minor but not nothing.

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 `from`, `side`, `amount` units and `maxLossPct`. The description adds only the maxLossPct ceiling of 15 and the idea that the simulation runs at the given size — marginal value beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb+resource: simulate a buy AND the sell-back at the same size on Arc, X1 or BNB Chain, returning pool, expected/minimum out and unsigned transactions. That distinguishes it clearly from swap_build or arc_exit_check by describing the round-trip simulation. It stops short of naming a sibling alternative, so it is clear but not fully differentiated.

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?

Gives an explicit when-to-use: 'before a bot buys a token', plus the concrete selection rule that a token whose round trip exceeds maxLossPct is refused. It also spells out the two-call payment protocol (call without `payment` for terms, sign, call again with `payment`). No alternative tool or when-not-to-use case is named, so it falls short of a 5.

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