Skip to main content
Glama

swap_quote_and_build

Costs 0.001 USDC per call via x402. Returns the best route and an unsigned transaction, and for Solana swaps a rug-pull risk check of the output token (mint/freeze authority, token-2022 traps, holder concentration) so agents do not buy honeypots. Same-chain Solana swaps route through Jupiter with a referral fee account. Cross-chain routes try LI.FI Intents (solver-based, competitive pricing) first, then fall back to classic LI.FI routing. Supports Solana, Ethereum, Base, Arbitrum, Polygon, Bitcoin and Tron. The response contains a serialized unsigned transaction to be signed and broadcast by the caller. A 30 bps platform fee is embedded in the route.

Input Schema

NameRequiredDescriptionDefault
amountYesInput amount in base units (lamports, wei, 1e-6 USDC)
toChainYes
priorityNofast
fromChainYes
inputTokenYesToken address/mint, or symbol (SOL, USDC, USDT, ETH)
outputTokenYesToken address/mint, or symbol
slippageBpsNo
userAddressYesWallet that signs the transaction on fromChain
paymentProofNoPayment proof: USDC tx hash on Polygon or Base (0x...) or Solana tx signature. Omit on the first call to receive the 402 payment instructions, pay, then call again with the proof.
destinationAddressNoReceiver on toChain; defaults to userAddress

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / fromChain / enum
      Previous value: -[
      -  "solana",
      -  "ethereum",
      -  "arbitrum",
      -  "base",
      -  "polygon"
      -]New value: +[
      +  "solana",
      +  "ethereum",
      +  "arbitrum",
      +  "base",
      +  "polygon",
      +  "bitcoin",
      +  "tron"
      +]
    • changedInput schema / properties / toChain / enum
      Previous value: -[
      -  "solana",
      -  "ethereum",
      -  "arbitrum",
      -  "base",
      -  "polygon"
      -]New value: +[
      +  "solana",
      +  "ethereum",
      +  "arbitrum",
      +  "base",
      +  "polygon",
      +  "bitcoin",
      +  "tron"
      +]
  2. Changed1 schema field changed
    • addedInput schema / properties / paymentProof
      Added value: +{
      +  "description": "Payment proof: USDC tx hash on Polygon or Base (0x...) or Solana tx signature. Omit on the first call to receive the 402 payment instructions, pay, then call again with the proof.",
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.3/5.0
Behavior5/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 it well: it discloses cost (0.001 USDC via x402), the 30 bps embedded platform fee, that the output is unsigned and must be broadcast by the caller, and that Solana outputs include a honeypot/rug-pull safety check. The payment-proof 402 handshake is also surfaced, giving an agent the key operational context before calling.

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?

Roughly seven dense sentences, each contributing distinct information (cost, return shape, risk check, routing, chains, signing model, fee) with no filler. It is slightly list-like rather than strictly front-loaded, but nothing is redundant.

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 10-parameter, no-annotation, no-output-schema mutation-adjacent tool, the description covers cost, payment flow, return contract, routing, and fee — most of what an agent needs. It omits response field details and the meaning of priority/slippage beyond schema defaults, but a caller can act correctly on what is given.

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 60% and the description reinforces the chain set and adds context that the transaction targets the caller's wallet on fromChain, while destinationAddress defaulting is documented in the schema. It does not add meaning for slippageBps or priority beyond the enum/default already in the schema, so it's a modest supplement rather than a full explanation.

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?

States a specific verb (returns a priced route and an unsigned transaction to sign/broadcast) and the exact resource (same-chain and cross-chain token swaps). It distinguishes itself from sibling read-only tools like token_audit, dex_search, and solana_network by making clear it produces a signable transaction, not just data.

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

Usage Guidelines3/5

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

The internal routing policy is described (Jupiter for Solana, LI.FI Intents with classic fallback for cross-chain), which implies when each path applies, but the description never says when an agent should call this instead of siblings like dex_search, token_audit, or wallet_balance, nor does it state exclusions. Usage is inferable rather than stated.

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.