> ## Documentation Index
> Fetch the complete documentation index at: https://docs.legend.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP tools and order review

> Preview tools for account reads, order preparation, and authorized mainnet execution.

These tools describe the MCP preview. Availability depends on the endpoint, grant, and assistant host. See [setup and availability](/api-reference/connectors/overview).

## Account reads

| 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 an order

`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.

1. Open the link to populate Legend’s Advanced trade form.
2. Confirm that the market, direction, base size, and limit price match your intent.
3. Review the current account, leverage, margin, and market conditions before submitting in Legend.

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.

## Execution tools

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](/api-reference/trading/execution) and [retry rules](/api-reference/trading/errors).

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.
