update_project
Modify project details by updating its name or description in the QuantConnect MCP Server. Submit the project ID along with optional new name or description to apply changes.
Instructions
Update a project's name and/or description.
Args: project_id: ID of the project to update name: Optional new name for the project description: Optional new description for the project
Returns: Dictionary containing update result
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| name | No | ||
| project_id | Yes |
Implementation Reference
- The core handler implementation for the 'update_project' tool. This async function, decorated with @mcp.tool(), handles updating a QuantConnect project's name and/or description by making an authenticated API request to 'projects/update'.@mcp.tool() async def update_project( project_id: int, name: Optional[str] = None, description: Optional[str] = None ) -> Dict[str, Any]: """ Update a project's name and/or description. Args: project_id: ID of the project to update name: Optional new name for the project description: Optional new description for the project 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.", } # Validate at least one field is provided if name is None and description is None: return { "status": "error", "error": "At least one of 'name' or 'description' must be provided for update", } try: # Prepare request data request_data: Dict[str, Any] = {"projectId": int(project_id)} if name is not None: request_data["name"] = name if description is not None: request_data["description"] = description # Make API request response = await auth.make_authenticated_request( endpoint="projects/update", method="POST", json=request_data ) # Parse response if response.status_code == 200: data = response.json() if data.get("success", False): update_fields = [] if name is not None: update_fields.append(f"name to '{name}'") if description is not None: update_fields.append(f"description") return { "status": "success", "project_id": project_id, "updated_fields": update_fields, "message": f"Successfully updated project {project_id}: {', '.join(update_fields)}", } else: # API returned success=false errors = data.get("errors", ["Unknown error"]) return { "status": "error", "error": "Project update failed", "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 update project: {str(e)}", "project_id": project_id, }
- quantconnect_mcp/main.py:46-52 (registration)The registration call register_project_tools(mcp) which defines and registers the update_project tool along with other project tools using the FastMCP instance.safe_print("🔧 Registering QuantConnect tools...") register_auth_tools(mcp) register_project_tools(mcp) register_file_tools(mcp) register_backtest_tools(mcp) register_live_tools(mcp) register_optimization_tools(mcp)
- quantconnect_mcp/src/server.py:73-79 (registration)Alternative registration point in server.py where register_project_tools(mcp) is called to register the tools.safe_print("🔧 Registering QuantConnect tools...") register_auth_tools(mcp) register_project_tools(mcp) register_file_tools(mcp) register_backtest_tools(mcp) register_live_tools(mcp) register_optimization_tools(mcp)