Skip to main content
Glama

read_project_collaborators

Retrieve a list of all collaborators working on a specific QuantConnect project to manage team access and permissions.

Instructions

List all collaborators on a project.

Args: project_id: ID of the project to list collaborators for

Returns: Dictionary containing list of project collaborators

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes

Implementation Reference

  • The core handler function for the 'read_project_collaborators' tool. It authenticates with QuantConnect, sends a POST request to the 'projects/collaboration/read' endpoint with the project ID, parses the response, and returns the list of collaborators or an error message.
    @mcp.tool()
    async def read_project_collaborators(project_id: int) -> Dict[str, Any]:
        """
        List all collaborators on a project.
    
        Args:
            project_id: ID of the project to list collaborators for
    
        Returns:
            Dictionary containing list of project collaborators
        """
        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 = {"projectId": project_id}
    
            # Make API request
            response = await auth.make_authenticated_request(
                endpoint="projects/collaboration/read", method="POST", json=request_data
            )
    
            # Parse response
            if response.status_code == 200:
                data = response.json()
    
                if data.get("success", False):
                    collaborators = data.get("collaborators", [])
                    
                    return {
                        "status": "success",
                        "project_id": project_id,
                        "collaborators": collaborators,
                        "total_collaborators": len(collaborators),
                        "message": f"Successfully retrieved {len(collaborators)} collaborators for project {project_id}",
                    }
                else:
                    # API returned success=false
                    errors = data.get("errors", ["Unknown error"])
                    return {
                        "status": "error",
                        "error": "Failed to read project collaborators",
                        "details": errors,
                        "project_id": project_id,
                    }
    
            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 project collaborators: {str(e)}",
                "project_id": project_id,
            }
  • Registration of project tools module (including read_project_collaborators) by calling register_project_tools(mcp) in the main entry point.
    register_auth_tools(mcp)
    register_project_tools(mcp)
    register_file_tools(mcp)
    register_backtest_tools(mcp)
    register_live_tools(mcp)
    register_optimization_tools(mcp)
  • Alternative registration of project tools module in server.py main function.
    register_auth_tools(mcp)
    register_project_tools(mcp)
    register_file_tools(mcp)
    register_backtest_tools(mcp)
    register_live_tools(mcp)
    register_optimization_tools(mcp)

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