Skip to main content
Glama

update_project_nodes

Activate specific nodes in a QuantConnect project to enable trading strategy components for execution and testing.

Instructions

Update the active state of the given nodes to true.

Args: project_id: ID of the project to update nodes for nodes: Dictionary mapping node IDs to their active state (true/false)

Returns: Dictionary containing update result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
nodesYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main execution logic for the 'update_project_nodes' tool. Decorated with @mcp.tool(), it authenticates with QuantConnect, prepares a POST request to the 'projects/nodes/update' endpoint with project_id and nodes dict, handles responses, and returns success/error dicts.
    @mcp.tool()
    async def update_project_nodes(
        project_id: int, nodes: Dict[str, bool]
    ) -> Dict[str, Any]:
        """
        Update the active state of the given nodes to true.
    
        Args:
            project_id: ID of the project to update nodes for
            nodes: Dictionary mapping node IDs to their active state (true/false)
    
        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,
                "nodes": nodes,
            }
    
            # Make API request
            response = await auth.make_authenticated_request(
                endpoint="projects/nodes/update", method="POST", json=request_data
            )
    
            # Parse response
            if response.status_code == 200:
                data = response.json()
    
                if data.get("success", False):
                    active_nodes = [node_id for node_id, active in nodes.items() if active]
                    
                    return {
                        "status": "success",
                        "project_id": project_id,
                        "updated_nodes": nodes,
                        "active_nodes": active_nodes,
                        "message": f"Successfully updated {len(nodes)} node(s) for project {project_id}, {len(active_nodes)} now active",
                    }
                else:
                    # API returned success=false
                    errors = data.get("errors", ["Unknown error"])
                    return {
                        "status": "error",
                        "error": "Failed to update project nodes",
                        "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 nodes: {str(e)}",
                "project_id": project_id,
            }
  • Registration of project tools (including 'update_project_nodes') by calling register_project_tools(mcp) during server initialization.
    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)
  • Alternative entrypoint registration of project tools (including 'update_project_nodes') by calling register_project_tools(mcp).
    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)
  • Type hints defining the input schema: project_id (int), nodes (Dict[str, bool]) and return Dict[str, Any].
    async def update_project_nodes(
        project_id: int, nodes: Dict[str, bool]
    ) -> Dict[str, Any]:
        """
        Update the active state of the given nodes to true.
    
        Args:
            project_id: ID of the project to update nodes for
            nodes: Dictionary mapping node IDs to their active state (true/false)
    
        Returns:
            Dictionary containing update result
        """
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Update') but doesn't clarify if this requires specific permissions, whether changes are reversible, or what happens to nodes not included in the dictionary. It mentions a return value but lacks details on error handling or side effects.

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 front-loaded with the core action, followed by structured Arg and Return sections. It's efficient with minimal waste, though the 'Returns' line is somewhat vague and could be more specific without adding bulk.

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 the tool has an output schema (which handles return values) but no annotations and 0% schema coverage, the description is moderately complete. It covers the basic action and parameters but lacks behavioral details like permissions or error cases, leaving gaps for a mutation tool with nested objects.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaningful context: 'project_id' is for identifying the project, and 'nodes' is a dictionary mapping node IDs to boolean active states. This clarifies the structure and purpose beyond the bare schema, though it doesn't specify format details like node ID types.

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 verb ('Update') and resource ('active state of the given nodes'), specifying what gets updated (active state to true). However, it doesn't explicitly differentiate from sibling tools like 'update_project' or 'update_project_collaborator' beyond the node focus, missing full sibling distinction.

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?

No guidance on when to use this tool versus alternatives is provided. The description lacks context about prerequisites, such as whether nodes must exist or be in a specific state, and doesn't mention any exclusions or related tools like 'read_project_nodes' for checking current states.

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