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 ...
This record as markdown: /tools/com-1inch-business-mcp/swap.md
What swap does on 1inch MCP
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.
| 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 | — | Order preset for fusion/cross-chain: fast (quicker fill), medium, slow (better rate) |
execute | boolean | — | 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 | — | Destination chain for cross-chain swap |
gasPrice | string | — | Network gas price in wei (optional; omit for fast default) |
slippage | number | — | Slippage tolerance in % (default 0.5) |
orderHash | string | — | Order hash for submit mode |
quoteOnly | boolean | — | If true, return quote comparison only (no tx/order) |
Parameters from the server's own tool schema.
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 definition "Swap tokens via 1inch. Supports classic (on-chain), Fusion (intent/gasless), and cross-chain swaps"
Risk signalsHigh parameter count (14 properties)
Attacks that exploit this kind of access
The rule that runs swap safely
PolicyLayer is an MCP gateway: it sits between your AI agents and 1inch MCP, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For swap, this is the rule to start with:
Any call to swap is blocked until a human approves it. The rest of the server keeps working.
The button opens the PolicyLayer dashboard: create your workspace, connect 1inch MCP, apply this rule, and every swap call is checked against it from then on.
Questions about 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). It is categorised as a Financial tool in the 1inch MCP MCP Server, which means it involves financial transactions. Block by default and require explicit approval.
swap accepts 12 parameters: dst, src, from, chain, amount, preset, execute, dstChain, gasPrice, slippage, orderHash, quoteOnly. Required: dst, src, from, chain, amount. The full parameter table on this page comes from the server's own tool schema.
Register the 1inch MCP server in PolicyLayer and add a rule for swap: 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 1inch MCP. Nothing to install.
swap is a Financial tool with critical risk. Critical-risk tools should be blocked by default and only enabled with explicit human approval.
Yes. Add a rate_limit block to the swap 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 swap. 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.
swap is provided by the 1inch MCP server (https://api.1inch.com/mcp/protocol). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on 1inch, and thousands of servers like it.
Across the catalogue