Skip to main content

Example Prompts & Responses

These examples demonstrate actual tool responses from the LI.FI MCP server. Use them as reference for understanding data formats and building integrations.

Get Chain Information

Prompt: “What are the details for Ethereum?” Tool called: get-chain-by-name with name: "ethereum"

Get Token Details

Prompt: “Get USDC token info on Ethereum” Tool called: get-token with chain: "1", token: "USDC"

Same-Chain Swap Quote

Prompt: “Get a quote to swap 0.01 ETH to USDC on Ethereum” Tool called: get-quote with:
Response (key fields):
Key fields to note:
  • estimate.toAmount: Expected USDC output (22.39 USDC with 6 decimals)
  • estimate.toAmountMin: Minimum after slippage (21.72 USDC)
  • transactionRequest: Ready-to-sign transaction object

Cross-Chain Swap Quote

Prompt: “Bridge 0.01 ETH from Ethereum to USDC on Base” Tool called: get-quote with:
Response (key fields):
Key fields to note:
  • executionDuration: Estimated ~47 seconds for cross-chain transfer
  • includedSteps: Shows the route (fee collection then bridge via NearIntents)

Check Wallet Balance

Prompt: “What’s the ETH balance of vitalik.eth?” Tool called: get-native-token-balance with chain: "1", address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Conversion: 32115625288281011210 / 10^18 = ~32.12 ETH

Code Samples

Build agents that connect to the LI.FI MCP server programmatically.

Anthropic API (MCP Connector) - TypeScript

The simplest approach. Anthropic handles the MCP connection. No MCP client library needed.

Anthropic API (MCP Connector) - Python

TypeScript (MCP SDK)

Python (MCP SDK)

Vercel AI SDK