Skip to main content
Glama

read_account

Retrieve organization account status and information from the QuantConnect trading platform to monitor trading resources and capabilities.

Instructions

Read the organization account status.

Returns: Dictionary containing account status and information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'read_account' tool. It retrieves the organization account status from the QuantConnect API using the configured authentication. Handles errors for missing auth, API failures, and parsing issues.
    @mcp.tool()
    async def read_account() -> Dict[str, Any]:
        """
        Read the organization account status.
    
        Returns:
            Dictionary containing account status and information
        """
        auth = get_auth_instance()
        if auth is None:
            return {
                "status": "error",
                "error": "QuantConnect authentication not configured. Use configure_auth() first.",
            }
    
        try:
            # Make API request
            response = await auth.make_authenticated_request(
                endpoint="account/read", method="POST"
            )
    
            # Parse response
            if response.status_code == 200:
                data = response.json()
    
                if data.get("success", False):
                    account = data.get("account", {})
                    
                    return {
                        "status": "success",
                        "account": account,
                        "message": "Successfully retrieved account information",
                    }
                else:
                    # API returned success=false
                    errors = data.get("errors", ["Unknown error"])
                    return {
                        "status": "error",
                        "error": "Failed to read account information",
                        "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 read account: {str(e)}",
            }

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