get_swap_quote
Maps to POST /quote. Returns the best swap quote across all integrated DEX protocols, with router, callData, value, price impact, route summary, and gas estimate in one response. Surplus and positive slippage are returned to the user in the same transaction. Supports an optional affiliateCode (re...
This record as markdown: /tools/defire-business-swapwizard-mcp/get-swap-quote.md
What get_swap_quote does on Swapwizard
AI agents call get_swap_quote to retrieve information from Swapwizard without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
side | string | Yes | Quote direction |
amount | string | Yes | Amount as stringified uint256 in token decimals |
chainId | integer | Yes | EVM chain ID (e.g. 56 for BSC) |
tokenIn | string | Yes | Input token address (0x0000...0000 for native coin) |
tokenOut | string | Yes | Output token address |
slippageBps | integer | — | Slippage tolerance in basis points (default: 100 = 1%) |
affiliateCode | string | — | Optional affiliate wallet address registered on-chain with SwapWizard — forwarded to the API so the affiliate fee for this operation is paid to that address. Om |
excludePositions | array | — | Positions to subtract from pool state during simulation — for a clean quote that excludes self-impact. Get these from list_user_lp_positions. |
Parameters from the server's own tool schema.
Why get_swap_quote is rated Low
This is a read-only tool that queries pricing and routing information across DEX protocols. Although it operates in a DeFi context with financial implications downstream, the tool itself performs no state changes, does not move funds, and does not execute swaps. It only retrieves and returns data (quotes and estimates) to inform decision-making.
From the tool's definition Tool returns quote data only: 'Returns signable data only; never signs or broadcasts.' Explicitly retrieves swap information (best quote, router, callData, price impact, route summary, gas estimate) without executing transactions.
Risk signalsHigh parameter count (12 properties)
Attacks that exploit this kind of access
The rule that runs get_swap_quote safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Swapwizard, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For get_swap_quote, this is the rule to start with:
get_swap_quote is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Swapwizard, apply this rule, and every get_swap_quote call is checked against it from then on.
Questions about get_swap_quote
Maps to POST /quote. Returns the best swap quote across all integrated DEX protocols, with router, callData, value, price impact, route summary, and gas estimate in one response. Surplus and positive slippage are returned to the user in the same transaction. Supports an optional affiliateCode (registered affiliate wallet address) forwarded to the API so the affiliate fee is paid on-chain to that address. Supports an excludePositions parameter that prices the swap excluding the caller's own LP position from pool state. Returns signable data only; never signs or broadcasts. EXECUTION FLOW: (1) If the input token is non-native, send an ERC-20 approve to the router and WAIT for on-chain confirmation. (2) Call this tool again for a fresh quote (quotes expire). (3) Send the tx to the router contract: to=router, data=callData, value=value. This requires a private key or wallet signer. ⚠️ PRICE IMPACT: The response includes a priceImpact field. Agents MUST present this value to the user and request explicit confirmation before executing. High price impact means the user will receive significantly less value than expected. ⚠️ ZERO OUTPUT: If the swap amount is too small relative to the token pair price ratio, the API returns HTTP 400 with "swap amount too small: output rounds to zero for this pair". Increase the amount or use a different pair. It is categorised as a Read tool in the Swapwizard MCP Server, which means it retrieves data without modifying state.
get_swap_quote accepts 8 parameters: side, amount, chainId, tokenIn, tokenOut, slippageBps, affiliateCode, excludePositions. Required: side, amount, chainId, tokenIn, tokenOut. The full parameter table on this page comes from the server's own tool schema.
Register the Swapwizard MCP server in PolicyLayer and add a rule for get_swap_quote: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Swapwizard. Nothing to install.
get_swap_quote is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the get_swap_quote rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for get_swap_quote. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
get_swap_quote is provided by the Swapwizard MCP server (@swapwizard/mcp-server). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Swapwizard, and thousands of servers like it.
This server
Across the catalogue