Skip to main content

Overview

The MCP server has 22 tools in 8 groups. Tools that operate on an agent require a connected wallet — call connect_wallet first, or the tool returns an error telling the LLM to connect one.

Wallet

Session management tools. Call connect_wallet before using any wallet-dependent tool.

connect_wallet

Connect a wallet address to the current session. All subsequent agent operations use this wallet.
ParameterTypeRequiredDescription
walletstringYesEthereum address (0x-prefixed, 40 hex chars)
Returns: Confirmation message with truncated address.

disconnect_wallet

Remove the wallet from the current session.
ParameterTypeRequiredDescription
No parameters
Returns: Confirmation message.

Account

Create and look up Giza smart accounts.

create_smart_account

Create a new Giza smart account for the given EOA (externally owned account). Also connects the wallet to the session automatically.
ParameterTypeRequiredDescription
eoastringYesUser’s EOA address
Returns: Smart account address. Wallet is connected to the session.
Smart account addresses are deterministic — calling create_smart_account with the same EOA always returns the same address.

get_smart_account

Look up the smart account associated with an EOA.
ParameterTypeRequiredDescription
eoastringYesUser’s EOA address
Returns: JSON with smart account address, backend wallet, and chain.

Protocol

Discover available tokens and DeFi protocols. These tools do not require a connected wallet.

get_protocols

List active DeFi protocols available for a given token.
ParameterTypeRequiredDescription
tokenstringYesToken contract address
Returns: JSON array of protocol names (e.g., ["aave", "compound", "moonwell"]).

get_tokens

List all tokens available on the configured chain.
ParameterTypeRequiredDescription
No parameters
Returns: JSON array of tokens with address, symbol, decimals, balance, and current price.

get_stats

Get aggregate statistics for the configured chain.
ParameterTypeRequiredDescription
No parameters
Returns: JSON with total balance, deposits, users, transactions, APR, and liquidity distribution.

get_tvl

Get the total value locked (TVL) on the configured chain.
ParameterTypeRequiredDescription
No parameters
Returns: JSON with TVL data.

Lifecycle

Manage the yield agent lifecycle. All tools in this group require a connected wallet.

activate_agent

Activate a yield agent after the user has deposited funds to their smart account.
ParameterTypeRequiredDescription
ownerstringYesOwner’s EOA address
tokenstringYesToken contract address to optimize
protocolsstring[]YesList of protocol names (min 1)
txHashstringYesDeposit transaction hash
constraintsArray<{ kind, params }>NoOptimization constraints (e.g., min_protocols)
Returns: JSON with activation result.
Activation is an important operation. The LLM should confirm with the user before calling this tool.

deactivate_agent

Stop the yield agent. Optionally transfers remaining funds back to the owner.
ParameterTypeRequiredDescription
transferbooleanNoTransfer funds to owner on deactivation (default: true)
Returns: Confirmation message.

top_up

Add funds to an active agent after the user makes an additional deposit.
ParameterTypeRequiredDescription
txHashstringYesDeposit transaction hash
Returns: Confirmation message.

run_agent

Trigger a yield optimization execution manually. The agent normally runs automatically, but this forces an immediate rebalance.
ParameterTypeRequiredDescription
No parameters
Returns: JSON with execution result.

Portfolio

Monitor agent performance. All tools in this group require a connected wallet.

get_portfolio

Get full portfolio info for the connected wallet.
ParameterTypeRequiredDescription
No parameters
Returns: JSON with deposits, withdrawals, status, active protocols, and activation dates.

get_performance

Get performance chart data for the connected wallet.
ParameterTypeRequiredDescription
fromstringNoStart date filter (YYYY-MM-DD)
Returns: JSON array of performance data points with dates and USD values.

get_apr

Get the APR (Annual Percentage Rate) for the connected wallet.
ParameterTypeRequiredDescription
startDatestringNoStart date (YYYY-MM-DD)
endDatestringNoEnd date (YYYY-MM-DD)
useExactEndDatebooleanNoUse exact end date instead of rounding
Returns: JSON with APR percentage.

get_deposits

List all deposits for the connected wallet.
ParameterTypeRequiredDescription
No parameters
Returns: JSON array of deposit records.

Financial

Withdrawals, transactions, and fees. All tools in this group require a connected wallet.

withdraw

Withdraw funds from the yield agent.
ParameterTypeRequiredDescription
amountstringNoAmount in smallest unit (e.g., "500000000" for 500 USDC). Omit for full withdrawal.
Returns: JSON with withdrawal result.
  • Partial withdrawal (amount provided): Withdraws the specified amount, agent stays active.
  • Full withdrawal (amount omitted): Withdraws everything and deactivates the agent.

get_withdrawal_status

Get the current withdrawal or deactivation status.
ParameterTypeRequiredDescription
No parameters
Returns: JSON with current status.

get_transactions

Get the transaction history for the connected wallet.
ParameterTypeRequiredDescription
limitnumberNoNumber of transactions to return (1-100, default: 20)
sortstringNoSort order
Returns: JSON array of transaction records.

get_fees

Get fee information for the connected wallet.
ParameterTypeRequiredDescription
No parameters
Returns: JSON with fee percentage and absolute fee values.

Rewards

claim_rewards

Claim available rewards for the connected wallet. Requires a connected wallet.
ParameterTypeRequiredDescription
No parameters
Returns: JSON with list of claimed reward tokens and amounts.

Optimizer

Yield optimization. These tools do not require a connected wallet.

optimize

Run the Giza yield optimizer to find the best allocation across protocols.
ParameterTypeRequiredDescription
tokenstringYesToken contract address
capitalstringYesTotal capital in smallest unit
currentAllocationsRecord<string, string>YesCurrent allocation per protocol (e.g., { "aave": "500000000" })
protocolsstring[]YesList of protocol names to consider
constraintsArray<{ kind, params }>NoOptimization constraints
walletstringNoWallet address for context
Returns: JSON with optimal allocations, APR improvement, gas estimates, and action plan.

Typical Conversation Flow

Here’s how the tools are typically used together in a conversation:
1

Connect wallet

LLM calls connect_wallet with the user’s address.
2

Explore options

LLM calls get_tokens to show available tokens, then get_protocols for a specific token.
3

Create smart account

LLM calls create_smart_account and tells the user where to deposit.
4

Activate agent

After the user deposits, LLM calls activate_agent with the deposit tx hash and chosen protocols.
5

Monitor

LLM calls get_portfolio, get_apr, and get_performance to show the user how their agent is doing.
6

Withdraw

When ready, LLM calls withdraw for partial or full withdrawal.