list_live_algorithms
Retrieve and filter live trading algorithms by status or time range to monitor active strategies.
Instructions
List live algorithms with optional filters.
Args: status: Optional status filter (e.g., "Running", "Stopped") start: Optional start time (Unix timestamp) end: Optional end time (Unix timestamp)
Returns: Dictionary containing list of live algorithms
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | ||
| start | No | ||
| end | No |
Implementation Reference
- The handler function for the 'list_live_algorithms' MCP tool. It is decorated with @mcp.tool() for automatic registration and schema generation. Authenticates using QuantConnect auth, sends POST to 'live/list' endpoint with optional filters (status, start, end timestamps), parses response, and returns success/error dict with list of live algorithms or error details.@mcp.tool() async def list_live_algorithms( status: Optional[str] = None, start: Optional[int] = None, end: Optional[int] = None, ) -> Dict[str, Any]: """ List live algorithms with optional filters. Args: status: Optional status filter (e.g., "Running", "Stopped") start: Optional start time (Unix timestamp) end: Optional end time (Unix timestamp) Returns: Dictionary containing list of live algorithms """ auth = get_auth_instance() if auth is None: return { "status": "error", "error": "QuantConnect authentication not configured. Use configure_auth() first.", } try: # Prepare request data request_data = {} if status: request_data["status"] = status if start is not None: request_data["start"] = start if end is not None: request_data["end"] = end # Make API request response = await auth.make_authenticated_request( endpoint="live/list", method="POST", json=request_data ) # Parse response if response.status_code == 200: data = response.json() if data.get("success", False): live_algorithms = data.get("live", []) return { "status": "success", "live_algorithms": live_algorithms, "total_count": len(live_algorithms), "filters": { "status": status, "start": start, "end": end, }, "message": f"Successfully retrieved {len(live_algorithms)} live algorithms", } else: # API returned success=false errors = data.get("errors", ["Unknown error"]) return { "status": "error", "error": "Failed to list live algorithms", "details": errors, } elif response.status_code == 401: return { "status": "error", "error": "Authentication failed. Check your credentials and ensure they haven't expired.", } else: return { "status": "error", "error": f"API request failed with status {response.status_code}", "response_text": ( response.text[:500] if hasattr(response, "text") else "No response text" ), } except Exception as e: return { "status": "error", "error": f"Failed to list live algorithms: {str(e)}", }
- quantconnect_mcp/main.py:51-51 (registration)Calls register_live_tools(mcp) which defines and registers all live trading tools including list_live_algorithms.register_live_tools(mcp)
- quantconnect_mcp/src/server.py:78-78 (registration)Calls register_live_tools(mcp) to register the live tools including list_live_algorithms.register_live_tools(mcp)
- quantconnect_mcp/src/tools/__init__.py:15-15 (registration)Exposes register_live_tools in __all__ for import."register_live_tools",