Skip to main content
Glama

update_project_collaborator

Modify collaborator access levels in QuantConnect projects to adjust live control permissions for specific users.

Instructions

Update collaborator permissions in a project.

Args: project_id: ID of the project containing the collaborator collaborator_user_id: User ID of the collaborator to update live_control: Whether to grant live control permission (optional)

Returns: Dictionary containing update result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
collaborator_user_idYes
live_controlNo

Implementation Reference

  • The core handler function for the 'update_project_collaborator' tool. Decorated with @mcp.tool() which also serves as its registration. It authenticates, prepares a POST request to QuantConnect's projects/collaboration/update endpoint, and handles the response, returning structured success/error results.
    @mcp.tool()
    async def update_project_collaborator(
        project_id: int, collaborator_user_id: str, live_control: Optional[bool] = None
    ) -> Dict[str, Any]:
        """
        Update collaborator permissions in a project.
    
        Args:
            project_id: ID of the project containing the collaborator
            collaborator_user_id: User ID of the collaborator to update
            live_control: Whether to grant live control permission (optional)
    
        Returns:
            Dictionary containing update result
        """
        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,
                "collaboratorUserId": collaborator_user_id,
            }
            
            if live_control is not None:
                request_data["liveControl"] = live_control
    
            # Make API request
            response = await auth.make_authenticated_request(
                endpoint="projects/collaboration/update", method="POST", json=request_data
            )
    
            # Parse response
            if response.status_code == 200:
                data = response.json()
    
                if data.get("success", False):
                    return {
                        "status": "success",
                        "project_id": project_id,
                        "collaborator_user_id": collaborator_user_id,
                        "live_control": live_control,
                        "message": f"Successfully updated collaborator {collaborator_user_id} for project {project_id}",
                    }
                else:
                    # API returned success=false
                    errors = data.get("errors", ["Unknown error"])
                    return {
                        "status": "error",
                        "error": "Failed to update project collaborator",
                        "details": errors,
                        "project_id": project_id,
                        "collaborator_user_id": collaborator_user_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 update project collaborator: {str(e)}",
                "project_id": project_id,
                "collaborator_user_id": collaborator_user_id,
            }
  • The call to register_project_tools(mcp) which triggers the definition and registration of all project tools including 'update_project_collaborator' via its @mcp.tool() decorator.
    safe_print("🔧 Registering QuantConnect tools...")
    register_auth_tools(mcp)
    register_project_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