Skip to main content
Glama

EVM swap price preview

swap_evm_price
Read-onlyIdempotent

PAID ($0.002/call). EVM swap price preview: expected and minimum output for a pair/amount before committing to a firm quote — the cheap look-before-you-swap call. Call once WITHOUT x402_payment to receive the x402 payment requirements (an accepts array); pay one of them with any x402 client/wallet, then call again with x402_payment set to the base64 X-PAYMENT payload. You are only charged when a result actually comes back.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainIdYesEVM chain id (e.g. 8453 = Base)
buyTokenYes'native' or the 0x… address of the token being bought
sellTokenYes'native' or the 0x… address of the token being sold
sellAmountYesinteger amount in the sell token's base units
x402_paymentNobase64 X-PAYMENT payload

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, which already establish the safety profile. The description adds substantial behavioral context: the two-step payment flow, the cost per call ($0.002/call), the fact that payment is only charged when a result comes back, and the nature of the response (an `accepts` array). This goes well beyond annotations and fully discloses the transactional behavior.

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 a single dense paragraph but every sentence carries necessary information: pricing, purpose, the two-step process, and payment mechanics. It is front-loaded with the price preview concept and payment cost. It could be slightly more structured (e.g., bullet points), but it remains efficient and free of filler. The length is justified by the complexity of the payment flow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema and a non-trivial payment workflow, the description covers all essential aspects: what it returns (expected and minimum output), how to initiate payment, how to complete the call, and the charging model. It explains the `accepts` array and the need to pass the base64 payload. No critical information is missing for an agent to correctly use this tool.

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 coverage is 100%, so each parameter already has a description. The tool description adds value by explaining the role of `x402_payment` in the overall flow (base64 X-PAYMENT payload) and the sequencing of calls. It clarifies that `sellToken` and `buyToken` accept 'native' or addresses, and that `sellAmount` is in base units, but these are already in the schema. The added context about payment flow elevates it above the baseline of 3.

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 clearly states the tool's purpose: 'EVM swap price preview: expected and minimum output for a pair/amount before committing to a firm quote.' It explicitly contrasts with a firm quote, differentiating from the sibling 'swap_evm_quote' without naming it directly but implying the distinction. The verb 'preview' and resource 'swap price' are specific and unambiguous.

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

Usage Guidelines5/5

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

The description provides explicit step-by-step usage: 'Call once WITHOUT x402_payment to receive the x402 payment requirements (an `accepts` array); pay one of them... then call again with `x402_payment` set...' It also explains when to use this tool ('the cheap look-before-you-swap call') and notes that it is paid per call only when a result is returned. This is explicit and actionable.

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