MCP Tools
These tools are available via the Legend MCP servers. Tools marked with (local only) are only available on the local MCP server (legend-cli mcp serve).
Reference Data
list_networks
List all supported blockchain networks.
Parameters: None
Returns: Array of {name, chain_id, display_name}. Use the name field (e.g. "base", "ethereum", "arbitrum") as the network parameter in other tools.
list_assets
List all supported tokens with decimals and network availability.
Returns: Map of symbol →
{name, decimals, networks}. Common decimals: USDC/USDT = 6, ETH/WETH = 18.
Accounts
list_accounts
List all sub-accounts under your Prime Account.
Parameters: None
Returns: Array of accounts with account_id, signer_type, wallet addresses, created_at. Call this first to discover account IDs.
get_account_info
Get details for a specific account.
Returns: Account details including
account_id, signer_type, ethereum_signer_address, legend_wallet_address, solana_wallet_address.
Portfolio
get_portfolio
Get an account’s current balances, token prices, yield positions, and rewards.
Returns: Full folio data. Amounts use scientific notation:
"300.25e6"= 300.25 USDC (6 decimals)"1.5e18"= 1.5 ETH (18 decimals)
- balances — token amounts per network per wallet (
balances/token/{network}/{symbol}/{wallet}) - prices — USD token prices (
prices/token/{symbol}) - yield_markets — available yield with APY (
yield_markets/{protocol}/{network}/{address}/{asset}) - rewards — unclaimed protocol rewards
get_activities
Get recent transaction history.
Returns: Array of activities with
status (pending, completed, failed), execution details, and transaction hashes.
Plans
Plans are free previews — nothing executes until you sign and callexecute_plan. Plans expire after 2 minutes.
create_earn_plan
Create a plan to earn yield on an asset.
Returns:
plan_id, digest (for signing), expires_at, steps (action preview).
Legend handles cross-chain bridging automatically — just specify the target network.
create_swap_plan
Create a plan to swap tokens.
Returns:
plan_id, digest, expires_at, steps.
Execution
execute_plan
Execute a previously created plan.
Returns:
plan_id, activity_id, status.
How to Sign (remote MCP only)
When using the remote MCP server, thecreate_*_plan tools return a digest field. To get the signature:
Using the CLI (Turnkey P256 accounts):
Local-Only Tools
These tools are only available on the local MCP server (legend-cli mcp serve). They leverage the P256 key stored on your machine.
login (local only)
Authenticate via Google SSO. Opens a browser, completes the OAuth flow, and saves a 30-day JWT to your profile.
Parameters: None
Returns: Confirmation with profile name.
create_account (local only)
Create a new sub-account with optional P256 key generation.
Returns: Account details including
account_id, signer_type, wallet addresses, and turnkey_sub_org_id.
With keygen: true (the default), the tool generates a P256 key in macOS Keychain, creates a Turnkey-backed account, and saves the key reference to your profile — all in one step.
sign_digest (local only)
Sign an EIP-712 digest using the profile’s P256 key via Turnkey.
Returns:
{signature: "0x..."} — the EIP-712 signature (132 hex chars).
plan_and_execute (local only)
Create a plan, sign it with the local P256 key, and execute — all in one tool call. This is the primary tool for agents that need to move funds.
Returns:
{plan_id, activity_id, status, action} — the execution result. Use get_activities with the activity_id to poll execution status.
Example — earn yield:
create_plan (local only)
Create a plan for any action type. Similar to the remote server’s create_earn_plan / create_swap_plan but unified into one tool.
Plus the same action-specific parameters as
plan_and_execute.
Returns: Full plan details including plan_id, digest, expires_at.