Shared Tools
Available regardless of integration path.recommend_integration_path
recommend_integration_path
Analyzes your developer stack and recommends whether to use API Direct or SDK Widgets.Inputs:
Returns: recommended path (API Direct or SDK Widgets) with rationale and suggested first steps.
| Field | Type | Description |
|---|---|---|
frontendFramework | string | e.g. next, react, remix, gatsby |
walletProvider | string | e.g. privy, dynamic, wagmi, ethers |
backendLanguage | string | e.g. typescript, javascript, python, go |
features | string[] | Features needed: swap, yield, wallet-positions |
get_health
get_health
Checks Deframe API health status. Use this to verify connectivity before starting a session or before running diagnostics.Inputs: noneReturns: health status and API version.
validate_api_key
validate_api_key
Validates an API key and returns account information.Inputs:
Returns: key validity, account name, plan tier, and rate limit details.
| Field | Type | Description |
|---|---|---|
apiKey | string | The API key to validate |
list_tokens
list_tokens
Lists all tokens supported by Deframe with optional filtering by chain.Inputs:
Returns: array of token objects with address, symbol, decimals, and chainId.
| Field | Type | Description |
|---|---|---|
chainId | number (optional) | Filter tokens by EVM chain ID |
get_error_explanation
get_error_explanation
Decodes a Deframe error code with causes, HTTP status, retryability flag, and resolution steps.Inputs:
Returns: description, causes, whether it is retryable, and suggested fixes.
| Field | Type | Description |
|---|---|---|
errorCode | string | Error code string (e.g. QUOTE_EXPIRED, INSUFFICIENT_BALANCE) |
API Direct — Swap
get_swap_quote
get_swap_quote
Request a quote for a same-chain or cross-chain token swap.Inputs:
Returns: quote object with
| Field | Type | Description |
|---|---|---|
fromChain | number | Source chain ID |
toChain | number | Destination chain ID |
fromToken | string | Token symbol or address |
toToken | string | Token symbol or address |
fromAmount | string | Amount in smallest unit (e.g. wei) |
fromAddress | string | Sender wallet address |
transactionRequest, expected output amount, fees, and expiry timestamp.execute_swap_bytecode
execute_swap_bytecode
Generate ready-to-sign transaction bytecode from a confirmed swap quote.Inputs:
Returns: ordered array of transaction objects (
| Field | Type | Description |
|---|---|---|
quoteId | string | Quote ID returned by get_swap_quote |
fromAddress | string | Sender wallet address |
to, data, value, chainId) to sign and broadcast.Sign and broadcast each transaction in the returned order. Skipping any transaction will cause the swap to fail.
get_swap_status
get_swap_status
Poll the status of a submitted swap transaction.Inputs:
Returns:
| Field | Type | Description |
|---|---|---|
txHash | string | Transaction hash from the source chain |
fromChain | number (optional) | Source chain ID — speeds up lookup |
toChain | number (optional) | Destination chain ID |
status (PENDING, DONE, FAILED) and substatus (COMPLETED, PARTIAL, REFUNDED).Poll every 10–30 seconds while status is PENDING.API Direct — Yield
list_strategies
list_strategies
List all available DeFi yield strategies.Inputs:
Returns: paginated array of strategy objects with id, protocol, APY, fee, and available actions.
| Field | Type | Description |
|---|---|---|
network | string (optional) | Filter by network name (e.g. polygon, arbitrum) |
asset | string (optional) | Filter by asset symbol (e.g. USDC) |
get_strategy
get_strategy
Retrieve a single strategy with full details.Inputs:
Returns: protocol details, asset, APY, supported actions, fees, and current state.
| Field | Type | Description |
|---|---|---|
strategyId | string | Strategy identifier (e.g. Aave-USDC-polygon) |
get_strategy_quote
get_strategy_quote
Calculate estimated output and fees for a deposit or withdrawal before generating bytecode.Inputs:
Returns: estimated output, fee charged, and slippage details.
| Field | Type | Description |
|---|---|---|
strategyId | string | Strategy identifier |
amount | string | Amount in asset’s smallest unit |
action | string | lend or withdraw |
wallet | string | Wallet address |
get_deposit_bytecode
get_deposit_bytecode
Generate transaction bytecode for depositing into a yield strategy.Inputs:
Returns: ordered array of transactions to sign and broadcast. May include a token approval transaction before the deposit.
| Field | Type | Description |
|---|---|---|
strategyId | string | Strategy identifier |
amount | string | Deposit amount in asset’s smallest unit |
wallet | string | Wallet address |
action | string | Typically lend |
Execute all transactions in order. Each transaction depends on the one before it.
get_withdraw_bytecode
get_withdraw_bytecode
Generate transaction bytecode for withdrawing from a yield strategy.Inputs:
Returns: ordered array of transactions to sign and broadcast.
| Field | Type | Description |
|---|---|---|
strategyId | string | Strategy identifier |
amount | string | Withdrawal amount in asset’s smallest unit |
wallet | string | Wallet address |
action | string | Typically withdraw |
get_wallet_positions
get_wallet_positions
Retrieve all open yield positions for a wallet address.Inputs:
Returns: array of positions with current value, principal, profit, and APY per strategy, plus a total balance summary in USD.
| Field | Type | Description |
|---|---|---|
wallet | string | Wallet address (checksummed or lowercase) |
get_wallet_history
get_wallet_history
Retrieve transaction history for a wallet in a specific strategy.Inputs:
Returns: paginated transaction history with timestamps, amounts, and status.
| Field | Type | Description |
|---|---|---|
wallet | string | Wallet address |
strategyId | string | Strategy identifier |
get_yield_by_identifier
get_yield_by_identifier
Find the highest-APY strategy matching an asset name or yield category.Inputs:
Returns: top-performing strategy matching the identifier, with full strategy details.
| Field | Type | Description |
|---|---|---|
identifier | string | Asset name (e.g. USDC) or category (e.g. stablecoin) |
API Direct — Code Generation
get_code_example
get_code_example
Generate a complete, runnable code example for a given feature and programming language.Inputs:
Returns: complete code snippet with comments, ready to copy into a project. Includes environment setup, API call, and response handling.
| Field | Type | Description |
|---|---|---|
feature | string | swap, yield, or wallet-positions |
language | string | typescript, javascript, python, go, or curl |
SDK Widgets
scaffold_project
scaffold_project
Generate all files needed to integrate Deframe SDK widgets into a frontend project.Inputs:
Returns: complete file tree — components, providers, and environment templates — ready to copy into your project.
| Field | Type | Description |
|---|---|---|
framework | string | next, react, remix, or gatsby |
features | string[] | swap, yield, or both |
walletProvider | string | Wallet connection library in use |
validate_provider_config
validate_provider_config
Validate a
Returns: validation result with any errors or warnings and suggested fixes for each issue.
DeframeProvider configuration object before using it in production.Inputs:| Field | Type | Description |
|---|---|---|
config | object | The provider config object to validate |
check_sdk_compatibility
check_sdk_compatibility
Check compatibility between
Returns: compatibility matrix, known issues, and recommended version combinations.
deframe-sdk, React, and your wallet provider before installing or upgrading.Inputs:| Field | Type | Description |
|---|---|---|
sdkVersion | string | Installed version of deframe-sdk |
reactVersion | string | Installed version of React |
walletProvider | string | Wallet library name and version |
setup_env
setup_env
Write Deframe environment variables to a
Returns: confirmation of which variables were written and the target file path.
.env or .env.local file.Inputs:| Field | Type | Description |
|---|---|---|
apiKey | string | Your Deframe API key |
file | string (optional) | Target file path. Default: .env.local |
Prompts
Prompts are pre-built conversation starters. Invoke them by name from your AI host to begin a guided workflow.choose_integration_path
choose_integration_path
Walks through a brief stack analysis and recommends API Direct or SDK Widgets for your project.Inputs:
feature, frontendFramework, walletProvider, backendLanguageUse this at the start of a new integration to get a tailored recommendation before writing any code.troubleshoot
troubleshoot
Diagnoses errors given an error code, transaction state, and description. Returns probable causes and resolution steps.Inputs:
errorCode, txState, descriptionUse this when a transaction is failing or an API call returns an unexpected error.api_quickstart
api_quickstart
Step-by-step guided session from first API call to a confirmed on-chain transaction, tailored to a specific feature and language.Inputs:
feature, languageUse this to get from zero to working code as fast as possible.api_integration_wizard
api_integration_wizard
Full integration session covering the complete flow: quote → bytecode → signing → status tracking. Walks through each step interactively.Inputs: none — the wizard collects everything it needs during the session.Use this when building an end-to-end swap or yield integration for the first time.
sdk_quickstart
sdk_quickstart
Fast-path SDK session: scaffold a project → write environment variables → validate the provider config.Inputs: none — the wizard collects framework and wallet provider during the session.Use this when you want working widget integration in the fewest possible steps.
sdk_integration_wizard
sdk_integration_wizard
Complete SDK setup session: compatibility check → project scaffolding → provider config validation.Inputs: none — the wizard collects all required details interactively.Use this for a thorough SDK setup with checks at each stage before proceeding.
sdk_migration_guide
sdk_migration_guide
Generates a migration guide for moving between
deframe-sdk versions, including all breaking changes and required code updates.Inputs: fromVersion, toVersionUse this before upgrading the SDK in a production project.Next Steps
Setup Guide
Install the MCP server in Claude Desktop, Cursor, or Windsurf
Quickstart
Make your first API call in 5 minutes without the MCP server