swap-mcp

v0.1.1
io.github.ShieldZCash/swap-mcp Checked 4 days ago Published 14 days ago

Non-custodial cross-chain swaps for AI agents: live route quotes and deposit swaps on 40+ chains.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_assets List swappable assets

Search the 340+ assets on 40+ chains that Shieldz Swap can route and return their exact asset ids. Use it when you are unsure of an id or which chains support a token (e.g. every chain that has USDC). Skip it for common native coins: get_quote and create_swap already accept shorthand like ZEC.ZEC or BTC.BTC. With no filters it also returns the list of chain codes. Read-only; the list is cached for 60 seconds.

ParameterTypeDescription
chainstringExact chain code filter, e.g. ETH, BASE, ARB, OP, POL, BSC, SOL, BTC, ZEC, TRON, NEAR. Leave empty for all chains.
limitintegerMaximum assets to return (1-100, default 40). Verified assets come first.
searchstringCase-insensitive symbol or asset id fragment, e.g. "usdc", "zec", "0x8335".

get_quote Quote a cross-chain swap

Get live prices for swapping one asset into another, across chains, by racing NEAR Intents, Chainflip, Relay, MAYAChain, BOB Gateway and Garden. Returns the best route and the alternatives, with output after fees, guaranteed minimum, all-in cost % and ETA. Use it to answer "how much X do I get for Y" and to show the user the numbers before create_swap. It creates nothing and needs no addresses. from_asset is what the user sends and to_asset what they receive; they may sit on different chains. Give each as an exact asset id or CHAIN.SYMBOL; when a shorthand is ambiguous (bridged USDC, for examp…

ParameterTypeDescription
amount *stringAmount of from_asset in normal decimal units as a string ("100", "0.05"), NOT base units or wei. Digits and one optional dot only; no commas, signs or exponents.
from_asset *stringSource (what the user sends). asset. Either an exact asset_id from list_assets ("BASE.USDC-0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913") or CHAIN.SYMBOL shorthand ("ZEC.ZEC", "BTC.BTC", "ETH.ETH", "SOL…
to_asset *stringDestination (what the user receives). asset. Either an exact asset_id from list_assets ("BASE.USDC-0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913") or CHAIN.SYMBOL shorthand ("ZEC.ZEC", "BTC.BTC", "ETH.ET…

create_swap Create a swap (deposit address)

Open a non-custodial swap and return a one-time deposit address. Use it only after the user has seen a quote, agreed to the amount and route, and given you both addresses. from_asset, to_asset and amount mean the same as in get_quote: pass the values the user agreed to. destination_address must be on to_asset's chain and refund_address on from_asset's chain, usually the sending wallet; BTC to ZEC, for example, needs a Zcash payout address and a Bitcoin refund address. NEVER invent, guess or reuse addresses from elsewhere in the conversation. Set protocol only to keep the route the user picked…

ParameterTypeDescription
amount *stringExact amount of from_asset the user will send, in normal decimal units ("100", "0.05"), not base units.
destination_address *stringAddress the user gave you on the destination chain (to_asset's chain). Swapped funds are paid here.
from_asset *stringSource (what the user sends). asset. Either an exact asset_id from list_assets ("BASE.USDC-0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913") or CHAIN.SYMBOL shorthand ("ZEC.ZEC", "BTC.BTC", "ETH.ETH", "SOL…
refund_address *stringAddress the user gave you on the source chain (from_asset's chain), usually the wallet they send from. Refunds go here if the swap fails or the price drops below the floor.
to_asset *stringDestination (what the user receives). asset. Either an exact asset_id from list_assets ("BASE.USDC-0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913") or CHAIN.SYMBOL shorthand ("ZEC.ZEC", "BTC.BTC", "ETH.ET…
protocolstringOptional. Pin this route, e.g. the alternative the user chose from get_quote. Omit to use the best route at creation time.

get_swap_status Check swap status

Look up a swap made with create_swap by its swap_id and explain where it is: PENDING (no deposit seen yet), PROCESSING, SUCCESS, FAILED, REFUNDED, INCOMPLETE_DEPOSIT (less than required arrived) or EXPIRED (address closed, never send to it). swap_id is the protocol-prefixed id create_swap returned, such as near:<deposit address> or chainflip:<block>-<network>-<channel>; pass it unchanged, prefix included. Returns amounts in normal units and the deposit, payout and refund transaction links. A malformed id is rejected before any request, an unknown one returns "No swap with that id", and a route…

ParameterTypeDescription
swap_id *stringswap_id exactly as returned by create_swap, e.g. "near:0xAbc..." or "chainflip:123-Btc-45".

report_deposit Report a deposit transaction

Tell the router the hash of the deposit transaction the user just sent, so the swap is detected immediately instead of on the next scan. Optional: swaps are detected without it, and it never moves funds. swap_id is the id create_swap returned for this swap. tx_hash is the hash of the transaction that sent funds to that swap's deposit_address on the source chain (0x-prefixed on EVM chains); never pass a payout hash or another swap's id. An unknown swap_id returns an error. Use it once, right after the user shares their tx hash, then follow up with get_swap_status. Calling it again with the same…

ParameterTypeDescription
swap_id *stringswap_id returned by create_swap.
tx_hash *stringHash of the user's deposit transaction on the source chain (0x... on EVM chains). Letters and digits only, up to 128 characters.