Skip to main content
Glama

update_project

Modify project details in QuantConnect by updating the name or description to reflect changes in your trading strategy development.

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
NameRequiredDescriptionDefault
project_idYes
nameNo
descriptionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the 'update_project' tool logic. It updates a QuantConnect project's name and/or description by making an authenticated API request to the 'projects/update' endpoint.
    @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,
            }
  • The registration of project tools (including 'update_project') by calling register_project_tools(mcp) in the main entry point.
    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)
  • The register_project_tools function defines and registers the 'update_project' tool using @mcp.tool() decorator.
    def register_project_tools(mcp: FastMCP):
        """Register project management tools with the MCP server."""
    
        @mcp.tool()
        async def create_project(
            name: str, language: str = "Py", organization_id: Optional[str] = None
        ) -> Dict[str, Any]:
            """
            Create a new project in your QuantConnect organization.
    
            Args:
                name: Project name (must be unique within organization)
                language: Programming language - "C#" or "Py" (default: "Py")
                organization_id: Optional organization ID (uses default if not specified)
    
            Returns:
                Dictionary containing project creation result with project details
            """
            auth = get_auth_instance()
            if auth is None:
                return {
                    "status": "error",
                    "error": "QuantConnect authentication not configured. Use configure_auth() first.",
                }
    
            # Validate language parameter
            valid_languages = ["C#", "Py"]
            if language not in valid_languages:
                return {
                    "status": "error",
                    "error": f"Invalid language '{language}'. Must be one of: {valid_languages}",
                }
    
            try:
                # Prepare request data
                request_data = {"name": name, "language": language}
    
                # Add organization ID if provided, otherwise use the auth instance's default
                if organization_id:
                    request_data["organizationId"] = organization_id
                elif auth.organization_id:
                    request_data["organizationId"] = auth.organization_id
    
                # Make API request
                response = await auth.make_authenticated_request(
                    endpoint="projects/create", method="POST", json=request_data
                )
    
                # Parse response
                if response.status_code == 200:
                    data = response.json()
    
                    if data.get("success", False):
                        # Extract project info from the response
                        projects = data.get("projects", [])
                        if projects:
                            # The newly created project should be in the list
                            created_project = None
                            for project in projects:
                                if (
                                    project.get("name") == name
                                    and project.get("language") == language
                                ):
                                    created_project = project
                                    break
    
                            if created_project:
                                return {
                                    "status": "success",
                                    "project": created_project,
                                    "message": f"Successfully created project '{name}' with {language} language",
                                }
    
                        # Fallback response if project not found in list
                        return {
                            "status": "success",
                            "project": {
                                "name": name,
                                "language": language,
                                "organizationId": request_data.get("organizationId"),
                            },
                            "message": f"Successfully created project '{name}' with {language} language",
                            "note": "Full project details not available in response",
                        }
                    else:
                        # API returned success=false
                        errors = data.get("errors", ["Unknown error"])
                        return {
                            "status": "error",
                            "error": "Project creation failed",
                            "details": errors,
                            "api_response": data,
                        }
    
                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 create project: {str(e)}",
                    "project_name": name,
                    "language": language,
                }
    
        @mcp.tool()
        async def read_project(project_id: Optional[int] = None) -> Dict[str, Any]:
            """
            Read project details by ID or list all projects if no ID provided.
    
            Args:
                project_id: Optional project ID to get specific project details.
                           If not provided, returns list of all projects.
    
            Returns:
                Dictionary containing project details or list of all projects
            """
            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 project_id is not None:
                    request_data["projectId"] = project_id
    
                # Make API request
                response = await auth.make_authenticated_request(
                    endpoint="projects/read", method="POST", json=request_data
                )
    
                # Parse response
                if response.status_code == 200:
                    data = response.json()
    
                    if data.get("success", False):
                        projects = data.get("projects", [])
                        versions = data.get("versions", [])
    
                        # If specific project ID was requested
                        if project_id is not None:
                            if projects:
                                return {
                                    "status": "success",
                                    "project": projects[0],
                                    "versions": versions,
                                    "message": f"Successfully retrieved project {project_id}",
                                }
                            else:
                                return {
                                    "status": "error",
                                    "error": f"Project with ID {project_id} not found",
                                }
    
                        # If no project ID specified, return all projects
                        else:
                            return {
                                "status": "success",
                                "projects": projects,
                                "total_projects": len(projects),
                                "versions": versions,
                                "message": f"Successfully retrieved {len(projects)} projects",
                            }
                    else:
                        # API returned success=false
                        errors = data.get("errors", ["Unknown error"])
                        return {
                            "status": "error",
                            "error": "Failed to read project(s)",
                            "details": errors,
                            "api_response": data,
                        }
    
                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(s): {str(e)}",
                    "project_id": project_id,
                }
    
        @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,
                }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Update' implies a mutation operation, the description doesn't disclose important behavioral traits: whether this requires specific permissions, if changes are reversible, what happens when only one field is provided, rate limits, or error conditions. It mentions a return format but lacks details on what 'update result' contains.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and well-structured with clear sections (purpose, args, returns). Every sentence earns its place: the first sentence states the purpose, and the subsequent sections provide necessary parameter and return information. It could be slightly more concise by combining the purpose and args sections.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that this is a mutation tool with no annotations but with an output schema (which handles return values), the description is moderately complete. It covers the basic purpose and parameters but lacks behavioral context (permissions, side effects) and doesn't fully compensate for the missing annotations. The output schema reduces the need to explain returns, but the description should still address mutation-specific concerns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate by explaining parameters. It does this effectively: it lists all 3 parameters (project_id, name, description), specifies that project_id is required (implied by 'ID of the project to update'), and indicates name/description are optional. However, it doesn't explain parameter constraints (e.g., name length limits) or that null values mean 'no change'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Update a project's name and/or description.' This specifies the verb (update), resource (project), and fields (name, description). However, it doesn't distinguish this tool from sibling tools like 'update_backtest', 'update_file_content', or 'update_project_collaborator', which all perform updates on different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing project), exclusions (e.g., what can't be updated), or when to choose this over other update tools like 'update_project_nodes'. The only implied usage is when you want to modify a project's name/description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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