{"at":"2026-11-23T05:15:54.300Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T05:15:54.742Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T05:15:54.843Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T05:15:55.259Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"resources":{},"tools":{}},"instructions":"Orderly Network trading via the locally installed `orderly` CLI. Private keys live in the OS keychain; this server never sees them and never signs.\n\n- Call auth_list first when the account ID is unknown.\n- Before any mutating call, call it with dry_run=true when supported, show the user the exact request, then repeat with dry_run=false.\n- For tasks without a dedicated tool, call orderly_commands then orderly_run. Never guess argument names.\n- Symbols are uppercase, e.g. PERP_ETH_USDC. Predict round symbols come from predict_rounds; never construct or reuse one.\n- Key, wallet and auth management is not available here; ask the user to use the CLI directly.\n\nProfile: core. Read-only: no. Network default: testnet.\n\nNo compatible orderly CLI was found. Tool definitions come from the bundled v2.1.2 schema; nothing can execute until the CLI is installed.\n\nNo compatible \"orderly\" CLI found (need v2.0.1+).\n  - /opt/server/node_modules/.bin/orderly: not found\n  - /opt/node_modules/.bin/orderly: not found\n  - /node_modules/.bin/orderly: not found\n  - /usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/orderly: not found\n  - /usr/local/sbin/orderly: not found\n  - /usr/local/bin/orderly: not found\n  - /usr/sbin/orderly: not found\n  - /usr/bin/orderly: not found\n  - /sbin/orderly: not found\n  - /bin/orderly: not found\n  - /home/lab/.local/bin/orderly: not found\n  - /home/lab/.cargo/bin/orderly: not found\n\nInstall the CLI:\n  curl -fsSL https://orderly.network/cli.sh | sh\n\nIf it is installed outside this process's PATH, set ORDERLY_BIN in the\nMCP client configuration, for example: \"ORDERLY_BIN=/home/you/.local/bin/orderly\".","protocolVersion":"2025-11-25","serverInfo":{"name":"orderly-trading-mcp","version":"0.2.3"}}}}
{"at":"2026-11-23T05:15:55.259Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T05:15:55.259Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T05:15:55.262Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true,"title":"List Orderly accounts"},"description":"List stored API-key accounts: account ID, wallet address, network and public key. No secrets are returned. Use an accountId from this list as the `account` argument on other tools. Call this first when the account is unknown.","inputSchema":{"additionalProperties":false,"properties":{"ids":{"description":"Output only account IDs, one per line (for scripting/piping)","type":"boolean"},"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"}},"type":"object"},"name":"auth_list","title":"List Orderly accounts"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true,"title":"Account balance"},"description":"Show the account's token holdings (USDC balance, frozen amount, isolated margin). Use positions_list for account value, free collateral and margin ratios.","inputSchema":{"additionalProperties":false,"properties":{"account":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Account ID (auto-resolves if single account)"},"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"}},"type":"object"},"name":"account_balance","title":"Account balance"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false,"title":"Place a perpetual order"},"description":"Place a perpetual-futures order. ALWAYS call with dry_run=true first to preview the exact request, then repeat with dry_run=false to execute. symbol must be uppercase (e.g. PERP_ETH_USDC). type is LIMIT, MARKET, IOC, FOK or POST_ONLY and is required for BUY/SELL orders. price is required for LIMIT, IOC, FOK and POST_ONLY. Short form: side=BID (market buy) or ASK (market sell), with no type or price. For Orderly Predict rounds use predict_buy/predict_sell instead. Set client_order_id to make retries idempotent. Returns the order object, including order_id.","inputSchema":{"additionalProperties":false,"oneOf":[{"not":{"anyOf":[{"required":["type"]},{"required":["price"]}]},"properties":{"side":{"enum":["BID","ASK"]}},"required":["side"]},{"properties":{"side":{"enum":["BUY","SELL"]},"type":{"enum":["LIMIT","IOC","FOK","POST_ONLY"]}},"required":["side","type","price"]},{"not":{"required":["price"]},"properties":{"side":{"enum":["BUY","SELL"]},"type":{"const":"MARKET"}},"required":["side","type"]}],"properties":{"account":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Account ID (auto-resolves if single account)"},"client_order_id":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Custom client order ID (optional)"},"dry_run":{"description":"Print the request payload without signing or sending it","type":"boolean"},"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"},"price":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Order price (required for LIMIT, IOC, FOK, POST_ONLY)"},"quantity":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"quantity"},"reduce_only":{"description":"Reduce-only order (can only reduce existing position, not open new)","type":"boolean"},"side":{"description":"side One of: BUY, SELL, BID, ASK.","enum":["BUY","SELL","BID","ASK"],"type":"string"},"symbol":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"symbol"},"type":{"description":"Order type (omitted for the short BID/ASK form) One of: LIMIT, MARKET, IOC, FOK, POST_ONLY.","enum":["LIMIT","MARKET","IOC","FOK","POST_ONLY"],"type":"string"}},"required":["symbol","side","quantity"],"type":"object"},"name":"order_place","title":"Place a perpetual order"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false,"title":"Cancel an order"},"description":"Cancel one order by order_id. symbol is optional and auto-fetched when omitted. Call with dry_run=true to preview the DELETE request before executing.","inputSchema":{"additionalProperties":false,"properties":{"account":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Account ID (auto-resolves if single account)"},"dry_run":{"description":"Print the request payload without signing or sending it","type":"boolean"},"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"},"order_id":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"order-id"},"symbol":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Symbol of the order (auto-fetched if not provided)"}},"required":["order_id"],"type":"object"},"name":"order_cancel","title":"Cancel an order"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false,"title":"Cancel all orders"},"description":"Cancel every open order, optionally limited to one symbol. This is destructive and has no dry-run; prefer order_cancel for a single order unless the user explicitly asks to cancel all.","inputSchema":{"additionalProperties":false,"properties":{"account":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Account ID (auto-resolves if single account)"},"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"},"symbol":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Filter by symbol (optional)"}},"type":"object"},"name":"order_cancel_all","title":"Cancel all orders"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true,"title":"List orders"},"description":"List orders, defaulting to open/incomplete orders. Filter by symbol, status, side, order_type or product_type. Set all=true to include completed orders. Use order_get via orderly_run for one specific order.","inputSchema":{"additionalProperties":false,"properties":{"account":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Account ID (auto-resolves if single account)"},"all":{"description":"Show all orders (overrides default INCOMPLETE filter)","type":"boolean"},"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"},"order_type":{"description":"Filter by type: LIMIT, MARKET One of: LIMIT, MARKET, IOC, FOK, POST_ONLY.","enum":["LIMIT","MARKET","IOC","FOK","POST_ONLY"],"type":"string"},"page":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Page number (default: 1)"},"product_type":{"description":"Filter by product type: PERP or BINARY One of: PERP, BINARY.","enum":["PERP","BINARY"],"type":"string"},"side":{"description":"Filter by side: BUY, SELL One of: BUY, SELL.","enum":["BUY","SELL"],"type":"string"},"size":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Page size (default: 25, max: 500)"},"sort_by":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Sort: CREATED_TIME_ASC, CREATED_TIME_DESC, UPDATED_TIME_ASC, UPDATED_TIME_DESC"},"status":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Filter by status. Individual: NEW, FILLED, CANCELLED, PARTIAL_FILLED, REJECTED. Bundled: INCOMPLETE, COMPLETED. Default: INCOMPLETE"},"symbol":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Filter by symbol"}},"type":"object"},"name":"order_list","title":"List orders"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true,"title":"List open positions"},"description":"List open positions plus account value, free collateral and margin ratios. Use product_type=BINARY for Orderly Predict positions (positive quantity is UP, negative is DOWN). Position quantities can lag a moment after a fill; re-read before closing or sizing a new order.","inputSchema":{"additionalProperties":false,"properties":{"account":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Account ID (auto-resolves if single account)"},"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"},"product_type":{"description":"Filter by product type: PERP or BINARY One of: PERP, BINARY.","enum":["PERP","BINARY"],"type":"string"}},"type":"object"},"name":"positions_list","title":"List open positions"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false,"title":"Close a position"},"description":"Close a position with a reduce-only MARKET order. Omit quantity to close the full position; pass quantity for a partial close. Perpetual futures only — use predict_close for Orderly Predict. Preview with dry_run=true.","inputSchema":{"additionalProperties":false,"properties":{"account":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Account ID (auto-resolves if single account)"},"dry_run":{"description":"Print the request payload without signing or sending it","type":"boolean"},"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"},"quantity":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Partial close quantity (default: full position)"},"symbol":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"symbol"}},"required":["symbol"],"type":"object"},"name":"positions_close","title":"Close a position"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false,"title":"Set leverage"},"description":"Set leverage for a symbol. value is required. Preview a change with dry_run=true. Use leverage_get to read the current leverage without mutating.","inputSchema":{"additionalProperties":false,"properties":{"account":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Account ID (auto-resolves if single account)"},"dry_run":{"description":"Print the request payload without signing or sending it","type":"boolean"},"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"},"symbol":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"symbol"},"value":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"value"}},"required":["symbol","value"],"type":"object"},"name":"leverage_set","title":"Set leverage"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true,"title":"Market price"},"description":"Get index price, mark price, 24h statistics, funding and open interest for one symbol (e.g. PERP_ETH_USDC). Read-only.","inputSchema":{"additionalProperties":false,"properties":{"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"},"symbol":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"symbol"}},"required":["symbol"],"type":"object"},"name":"market_price","title":"Market price"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true,"title":"Market order book"},"description":"Get the order book for one symbol, including best bid/ask and depth. Use it to price limit orders. Read-only.","inputSchema":{"additionalProperties":false,"properties":{"depth":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Number of price levels per side (default: all)"},"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"},"symbol":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"symbol"}},"required":["symbol"],"type":"object"},"name":"market_orderbook","title":"Market order book"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true,"title":"Candlestick data"},"description":"Get candlestick/kline data. type is one of 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w, 1mon; size defaults to 100 (max 1000). Read-only.","inputSchema":{"additionalProperties":false,"properties":{"network":{"description":"Network override for this call. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"},"size":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Number of candles (default: 100, max: 1000)"},"symbol":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"symbol"},"type":{"description":"type One of: 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w, 1mon.","enum":["1m","5m","15m","30m","1h","4h","12h","1d","1w","1mon"],"type":"string"}},"required":["symbol","type"],"type":"object"},"name":"kline","title":"Candlestick data"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true,"title":"Read leverage"},"description":"Read the current leverage and margin mode for a symbol. Read-only; use leverage_set to change it.","inputSchema":{"additionalProperties":false,"properties":{"account":{"description":"Account ID. Defaults to ORDERLY_MCP_ACCOUNT, then the CLI default.","type":"string"},"network":{"description":"Network override for this call.","enum":["mainnet","testnet"],"type":"string"},"symbol":{"description":"Symbol, e.g. PERP_ETH_USDC.","type":"string"}},"required":["symbol"],"type":"object"},"name":"leverage_get","title":"Read leverage"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true,"title":"Search the Orderly CLI commands"},"description":"Search the orderly CLI command surface available to this server. Use this before orderly_run whenever a dedicated tool does not cover the task. Returns command names, whether they mutate, usage, argument names/types/enums and help. Pass an exact command name (kebab-case or snake_case) for full detail, or a keyword to search. detail='full' includes long_about and complete argument help.","inputSchema":{"additionalProperties":false,"properties":{"detail":{"description":"summary (default) omits long help; full includes long_about and every argument description.","enum":["summary","full"],"type":"string"},"limit":{"description":"Maximum commands to return (default 50, max 200).","maximum":200,"minimum":1,"type":"integer"},"mutates":{"description":"Filter to mutating (true) or read-only (false) commands.","type":"boolean"},"offset":{"description":"Number of matching commands to skip (default 0).","minimum":0,"type":"integer"},"query":{"description":"Command name (order-place), keyword (algo, predict, history), or empty to list available commands.","type":"string"}},"type":"object"},"name":"orderly_commands","title":"Search the Orderly CLI commands"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true,"title":"Run a read-only Orderly CLI command"},"description":"Run an allowed read-only Orderly CLI command with structured arguments. Use this instead of orderly_run for reads when your client asks for confirmation on destructive tools. Mutating commands are rejected. Prefer a dedicated read tool when one exists; call orderly_commands first for exact argument names and enums.","inputSchema":{"additionalProperties":false,"properties":{"args":{"additionalProperties":true,"description":"Structured arguments keyed by the names returned by orderly_commands. Put network here, or use the top-level network field.","type":"object"},"command":{"description":"Read-only CLI command name, e.g. \"trades\" or \"funding-rates\". Must appear in orderly_commands.","type":"string"},"network":{"description":"Network override for this call. Takes precedence over args.network. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"}},"required":["command"],"type":"object"},"name":"orderly_read","title":"Run a read-only Orderly CLI command"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false,"title":"Run an Orderly CLI command"},"description":"Run an allowed Orderly CLI command with structured arguments. Prefer a dedicated tool when one exists; use this for commands that do not have one. Call orderly_commands first to get exact argument names, enums and required flags. Examples: algo_order_place, order_edit, order_get, trades, funding_rates, symbols, predict_rounds. Mutating commands execute immediately unless they support dry_run and it is set to true — always preview first. Key, wallet and auth management commands (create/import/export/logout) are never available. Pass network to override the default.","inputSchema":{"additionalProperties":false,"properties":{"args":{"additionalProperties":true,"description":"Structured arguments keyed by the names returned by orderly_commands, e.g. {\"symbol\":\"PERP_ETH_USDC\",\"side\":\"BUY\"}. Put network here, or use the top-level network field.","type":"object"},"command":{"description":"CLI command name, e.g. \"order-place\" or \"order_place\". Must appear in orderly_commands.","type":"string"},"network":{"description":"Network override for this call. Takes precedence over args.network. Defaults to ORDERLY_MCP_NETWORK, then the CLI config.","enum":["mainnet","testnet"],"type":"string"}},"required":["command"],"type":"object"},"name":"orderly_run","title":"Run an Orderly CLI command"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Orderly CLI status"},"description":"Report CLI discovery, the selected binary and version, the schema source, profile, network and account configuration. Call this when a trading tool reports that the orderly CLI is missing, too old, or misconfigured. When no CLI is installed, the other tools are listed from the bundled schema but cannot execute.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"orderly_status","title":"Orderly CLI status"}]}}}
