# 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.

Agent View of the PolicyLayer registry record for `get_swap_quote`. HTML page: https://policylayer.com/tools/defire-business-swapwizard-mcp/get-swap-quote

## Facts

- Tool: `get_swap_quote`
- Server: Swapwizard (`@swapwizard/mcp-server`) — https://policylayer.com/tools/defire-business-swapwizard-mcp.md
- Install: `npx -y @swapwizard/mcp-server`
- Homepage: https://github.com/DeFiRe-business/swapwizard-mcp
- Risk category: Read (Low risk)
- Registry record: grade D, identity unverified
- Server auth posture: open
- Server rate-limited: no
- Parameters: 8 (5 required)
- Recommended policy verdict: Allowed

## Parameters

| 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 | no | Slippage tolerance in basis points (default: 100 = 1%) |
| `affiliateCode` | string | no | 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 | no | 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.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_swap_quote",
    "arguments": {
      "side": "<side>",
      "amount": "<amount>",
      "chainId": 0,
      "tokenIn": "<tokenIn>",
      "tokenOut": "<tokenOut>"
    }
  }
}
```

## 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 own 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 signals: High parameter count (12 properties)

## Use case

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.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Swapwizard:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "get_swap_quote": {}
  }
}
```

## Other tools on Swapwizard (10)

- `get_clean_quote` — Financial — https://policylayer.com/tools/defire-business-swapwizard-mcp/get-clean-quote.md
- `zap_into_lp_position` — Financial — https://policylayer.com/tools/defire-business-swapwizard-mcp/zap-into-lp-position.md
- `zap_out_of_lp_position` — Financial — https://policylayer.com/tools/defire-business-swapwizard-mcp/zap-out-of-lp-position.md
- `analyze_pool` — Read — https://policylayer.com/tools/defire-business-swapwizard-mcp/analyze-pool.md
- `check_api_health` — Read — https://policylayer.com/tools/defire-business-swapwizard-mcp/check-api-health.md
- `get_setup_guide` — Read — https://policylayer.com/tools/defire-business-swapwizard-mcp/get-setup-guide.md
- `get_supported_chains` — Read — https://policylayer.com/tools/defire-business-swapwizard-mcp/get-supported-chains.md
- `get_supported_dexes` — Read — https://policylayer.com/tools/defire-business-swapwizard-mcp/get-supported-dexes.md
- `list_user_lp_positions` — Read — https://policylayer.com/tools/defire-business-swapwizard-mcp/list-user-lp-positions.md
- `search_liquidity_pools` — Read — https://policylayer.com/tools/defire-business-swapwizard-mcp/search-liquidity-pools.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=defire-business-swapwizard-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/defire-business-swapwizard-mcp
