# swap

[Requires authentication] This tool needs OAuth. If it returns an authentication error, prompt the user to connect/authenticate this MCP server (OAuth), then retry. Swap tokens via 1inch. Supports classic (on-chain), Fusion (intent/gasless), and cross-chain swaps. Omit preferredType and the tool picks a type for you; set preferredType (classic, fusion, crosschain) to choose explicitly. When quoteOnly returns a recommended type and that type is available, present only that type to the user. Do not mention, compare, or suggest other swap types unless the user explicitly asks to compare alternatives. ERC-20 source tokens may require a one-time approval transaction before the swap can proceed; the approval costs native gas on the source chain even for gasless Fusion/cross-chain swaps. When a response includes an approval block, tell the user upfront (approval.estimatedCost holds the estimated cost in native units). Usage modes: 1. Quote (quoteOnly=true): Returns only one swap type and its quote. If you pass preferredType explicitly (classic, fusion, or crosschain), the response returns that exact type (when a quote for it is available). If preferredType is omitted, the tool compares classic, Fusion, and cross-chain internally and picks the best one. The chosen type is echoed as recommended. 2. Execute (default): Returns data to sign. Response type depends on swap mode: - Classic → {type:"classic", step:"approve"|"swap", tx:{to,data,value}} → sign with eth_sendTransaction, wait for receipt. If step="approve", sign the approve tx first, then call swap again for the actual swap tx. - Fusion → {type:"fusion", orderHash, typedData} → sign typedData with eth_signTypedData_v4, then call this tool again with signedOrder=<signature> and orderHash. - Cross-chain → {type:"crosschain", orderHash, typedData, srcChain, dstChain} → same as Fusion: sign typedData, then submit with signedOrder. 3. Submit (signedOrder=<sig>): Submit a previously signed Fusion/cross-chain order. Returns {status:"submitted", orderHash}. Flows: - Full flow: quote first (quoteOnly=true), then execute with chosen preferredType, then sign + submit. - Shortcut: skip the quote — call directly without quoteOnly. Omit preferredType to let the tool pick a type, or set preferredType explicitly. Set dstChain for cross-chain. Responses that require on-chain transactions link to a guide. Use the product_api tool with path="/web3/{chainId}" to broadcast (see linked guide for body format). With an active WalletConnect session (walletconnect action=connect), swap execution is automatic by default: classic approve/swap txs, Fusion/cross-chain sign-and-submit, and native escrow sends are prompted in the user’s wallet — no manual broadcast or separate submit step. Set execute=false to receive unsigned payloads instead. Set execute=true to require WalletConnect (fails if not connected).

Agent View of the PolicyLayer registry record for `swap`. HTML page: https://policylayer.com/tools/com-1inch-business-mcp/swap

## Facts

- Tool: `swap`
- Server: 1inch MCP (`https://api.1inch.com/mcp/protocol`) — https://policylayer.com/tools/com-1inch-business-mcp.md
- Homepage: https://github.com/1inch/1inch-ai
- Risk category: Financial (Critical risk)
- Registry record: grade F, identity unverified
- Server auth posture: open
- Server rate-limited: no
- Parameters: 12 (5 required)
- Recommended policy verdict: Approval-gated

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `dst` | string | yes | Destination token address or symbol (e.g. ETH, 0x...) |
| `src` | string | yes | Source token address or symbol (e.g. USDC, 0x...) |
| `from` | string | yes | Wallet address executing the swap |
| `chain` | integer | yes | Chain ID (e.g. 1 for Ethereum, 8453 for Base) |
| `amount` | string | yes | Amount in wei/smallest unit. Pass large amounts as a string to avoid precision loss. |
| `preset` | string | no | Order preset for fusion/cross-chain: fast (quicker fill), medium, slow (better rate) |
| `execute` | boolean | no | Optional. When a WalletConnect session is active, defaults to true: classic approve/swap txs, Fusion/cross-chain EIP-712 sign+submit, and native escrow sends ar |
| `dstChain` | integer | no | Destination chain for cross-chain swap |
| `gasPrice` | string | no | Network gas price in wei (optional; omit for fast default) |
| `slippage` | number | no | Slippage tolerance in % (default 0.5) |
| `orderHash` | string | no | Order hash for submit mode |
| `quoteOnly` | boolean | no | If true, return quote comparison only (no tx/order) |

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": "swap",
    "arguments": {
      "dst": "<dst>",
      "src": "<src>",
      "from": "<from>",
      "chain": 0,
      "amount": "<amount>"
    }
  }
}
```

## Why swap is rated Critical

This tool executes token swaps on blockchain networks, which constitutes a financial transaction moving crypto assets. Misuse could result in irreversible loss of funds across chains. It requires authentication (OAuth), indicating real financial operations, not simulated ones. The blast radius is critical as it can move arbitrary token amounts across chains.

From the tool's own definition: "'Swap tokens via 1inch. Supports classic (on-chain), Fusion (intent/gasless), and cross-chain swaps'"

Risk signals: High parameter count (14 properties)

## Use case

AI agents use swap to commit financial operations through 1inch MCP, usually the final step of a payment, billing, or trading workflow. A call moves real money.

## Recommended policy (PolicyLayer)

Verdict: **Approval-gated**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches 1inch MCP:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "swap": {
      "deny_if": [
        {
          "conditions": [],
          "on_deny": "Requires human approval."
        }
      ]
    }
  }
}
```

## Other tools on 1inch MCP (8)

- `orderbook` — Financial — https://policylayer.com/tools/com-1inch-business-mcp/orderbook.md
- `product_api` — Financial — https://policylayer.com/tools/com-1inch-business-mcp/product-api.md
- `walletconnect` — Financial — https://policylayer.com/tools/com-1inch-business-mcp/walletconnect.md
- `aqua` — Read — https://policylayer.com/tools/com-1inch-business-mcp/aqua.md
- `debug` — Read — https://policylayer.com/tools/com-1inch-business-mcp/debug.md
- `get_example` — Read — https://policylayer.com/tools/com-1inch-business-mcp/get-example.md
- `list_examples` — Read — https://policylayer.com/tools/com-1inch-business-mcp/list-examples.md
- `search` — Read — https://policylayer.com/tools/com-1inch-business-mcp/search.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=com-1inch-business-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/com-1inch-business-mcp
