Skip to main content
Glama
Rift Finance MCP Server

Rift Finance MCP Server

Official
by Rift-FI

rift_swap

Swaps one token for another on a single chain through a smart wallet, offering gasless or paid-gas execution; use bridging for cross-chain transfers.

Instructions

Swap one token for another on a single chain via the user's smart wallet. SAME-CHAIN ONLY — for cross-chain use rift_bridge_execute. REAL TX — confirm with user.

DEPRECATED upstream: the backend swap endpoint may be unavailable; if it fails, tell the user to swap in the Rift app. When it works it returns an APPROVAL REQUIRED link for the user (passkey); check with rift_get_approval, never call again to retry.

Use 'flow: gasless' (recommended) for sponsored gas via UserOperation; use 'normal' to pay gas yourself. For known tokens (USDC, USDT, WETH, etc.) the chain's defaults are used; pass token_to_sell_address / token_to_buy_address only for arbitrary ERC-20s. For native ETH legs set isEth (selling ETH) or isBuyingEth (buying ETH).

'value' is the amount of token_to_sell, in human units (e.g. '10' for 10 USDC). To target a specific output, pass amountOut instead.

Requires login.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>",
      "token_to_sell": "<token_to_sell>",
      "token_to_buy": "<token_to_buy>",
      "value": "<value>"
    },
    "name": "rift_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
flowNogasless = no gas fee for user (recommended). normal = user pays gas in native token.gasless
chainYesChain to swap on: BASE, POLYGON, ARBITRUM, ETHEREUM, OPTIMISM, etc
isEthNoTrue if selling native ETH (not WETH)
valueYesAmount of token_to_sell in human units (e.g. '10' for 10 USDC)
amountOutNoOptional: target output amount (exact-out swap). Don't combine with normal value-based usage unless you know the upstream supports it.
isBuyingEthNoTrue if buying native ETH (not WETH)
token_to_buyYesToken symbol you're buying: WETH, USDC, etc.
token_to_sellYesToken symbol you're selling: USDC, USDT, WETH, etc.
token_to_buy_addressNoERC-20 contract address — only needed for arbitrary tokens not in the SDK's known list
token_to_sell_addressNoERC-20 contract address — only needed for arbitrary tokens not in the SDK's known list

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so well: it declares this is a REAL transaction requiring user confirmation, notes it requires login, discloses the deprecated upstream endpoint, and explains that a successful call returns an APPROVAL REQUIRED passkey link so the agent must poll rift_get_approval rather than re-invoke. Slightly less complete on what a failed or partial swap does to funds.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with scope and risk ('REAL TX — confirm with user') before the details, and organized into short paragraphs that each cover a distinct concern. Dense but nearly every sentence carries decision-relevant information; only the deprecation paragraph is slightly verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter mutating tool with no output schema and no annotations, the description covers purpose, routing, auth, gas mode, approval handoff, deprecation, and parameter conventions. Nothing an agent needs in order to call it safely appears to be missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: known-symbol tokens use chain defaults while token_to_sell_address/token_to_buy_address are only for arbitrary ERC-20s, isEth/isBuyingEth mark native ETH legs, 'value' is in human units, and amountOut is the exact-out alternative to value. That guidance on when to use which amount field goes beyond the schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Swap one token for another on a single chain via the user's smart wallet') and immediately distinguishes scope from the cross-chain sibling rift_bridge_execute. An agent can pick between rift_swap and rift_bridge_execute without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit routing ('SAME-CHAIN ONLY — for cross-chain use rift_bridge_execute'), a failure path (if the deprecated endpoint fails, direct the user to the Rift app), an approval workflow (check rift_get_approval, do not retry), and a flow choice with a recommendation (gasless for sponsored gas, normal to pay gas). All alternatives and preconditions are named rather than inferred.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools