Skip to main content
Glama

swap_evm_price

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. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

No annotations are provided, so the description fully carries the burden. It discloses payment requirements ($0.002/call, charged only when a result returns), the two-phase flow, and the x402 payment mechanism. This is comprehensive for a paid preview tool.

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 three sentences long and front-loads the key purpose and cost. It could be slightly more structured (e.g., adding a separator between phases), but every sentence earns its place with essential information. Minor inefficiency in the second sentence's length.

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?

Given there is no output schema, the description adequately covers the return values (expected and minimum output) and the two-phase process. It also explains when the cost is incurred. For a preview tool with a clear calling pattern, this is complete.

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. The description adds value by explaining how the optional x402_payment parameter is used in the two-phase flow, which is not apparent from the schema alone. No additional details on chain ID or token formats are needed.

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 specifies the tool is for previewing expected and minimum output for an EVM swap before committing to a firm quote, distinguishing it from siblings like swap_evm_quote, which likely provides a firm quote. The verb "preview" and resource "swap price" are clear.

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 explicitly explains the two-phase calling pattern: call once without x402_payment to get payment requirements, then pay a requirement and call again with x402_payment. It also states the tool is for looking before swapping, implying it should be used before requesting a firm quote from swap_evm_quote.

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