Legend documentation
Preview tools for account reads, order preparation, and authorized mainnet execution.
These tools describe the Legend MCP connector. Availability depends on the endpoint, grant, and assistant host. See setup and availability.
| Tool | Purpose |
|---|---|
get_account | Account identity, unified balances, withdrawable funds, and available-to-trade estimate |
list_positions | Open positions and their liquidation prices and unrealized PnL |
list_orders | Paginated orders; use status=open for open orders |
get_order | Retrieve a single order by a supported reference |
list_fills | Paginated executed fills and fees |
get_operation | Reconcile the outcome of a previous execution operation |
Read responses use the Trading API's canonical decimal strings and display fields. Preserve market precision rather than rounding all instruments the same way. Follow pagination when has_more is true.
prepare_order validates a perpetual GTC limit-order proposal with an explicit market, side, base-asset size, and limit price. It returns a review link, not an execution receipt. It does not reserve margin or guarantee that the order will be accepted later.
Proposal links expire after 15 minutes. They contain no account credential. Opening a proposal while the app is in a non-mainnet mode is blocked; it does not silently switch networks or execute. This proposal flow currently supports perpetual GTC limit orders only.
The trading endpoint additionally exposes the following tools to grants with trading permission:
| Tool | Purpose |
|---|---|
place_order | Submit a supported order |
modify_order | Modify an existing order |
cancel_order | Cancel an order |
set_leverage | Change a market's leverage settings |
adjust_isolated_margin | Adjust isolated position margin |
place_twap | Submit a supported TWAP |
cancel_twap | Cancel a TWAP |
Each execution call requires an idempotency_key. Reuse the same key for a retry of the same action; use a new key for a new intended action. When an outcome is unknown, query the operation and reconcile it before attempting a replacement. See execution and retry rules.
Execution uses the shared Trading API validations and mainnet account permissions. An accepted request is not necessarily a completed fill. Read the returned status and reconcile the resulting order or operation.