Skip to main content
Glama

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
NameRequiredDescriptionDefault
statusNo
startNo
endNo

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)}",
            }
  • Calls register_live_tools(mcp) which defines and registers all live trading tools including list_live_algorithms.
    register_live_tools(mcp)
  • Calls register_live_tools(mcp) to register the live tools including list_live_algorithms.
    register_live_tools(mcp)
  • Exposes register_live_tools in __all__ for import.
    "register_live_tools",

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/taylorwilsdon/quantconnect-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server