Skip to main content
Glama

create_project

Create a new trading strategy project in QuantConnect by specifying project name, programming language (C# or Python), and optional organization ID.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
languageNoPy
organization_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler implementation for the 'create_project' tool. This async function is decorated with @mcp.tool() and handles authentication, input validation, API request to QuantConnect's projects/create endpoint, and response parsing.
    @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,
            }
  • Type hints and docstring defining the input schema (name: str, language: str='Py', organization_id: Optional[str]) and output as Dict[str, Any] with status, project details, or error information.
    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
        """
  • The register_project_tools function where @mcp.tool() decorator registers the create_project handler with the FastMCP instance.
    def register_project_tools(mcp: FastMCP):
        """Register project management tools with the MCP server."""
    
        @mcp.tool()
  • Top-level registration during server startup: call to register_project_tools(mcp) which includes registration of create_project tool.
    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)
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. It states the tool creates a project but does not cover critical aspects like required permissions, whether the operation is idempotent, error handling, or rate limits. The mention of a 'unique' name constraint is helpful but insufficient for a mutation tool.

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 well-structured with a clear opening sentence followed by Args and Returns sections. It avoids redundancy and is appropriately sized for the tool's complexity, though the 'Returns' section could be more concise given the output schema exists.

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?

For a mutation tool with no annotations and an output schema, the description covers the basic purpose and parameters adequately. However, it lacks behavioral details like side effects or error conditions, making it incomplete for safe agent use despite the output schema handling return values.

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 compensates by explaining all three parameters: 'name' (must be unique), 'language' (options and default), and 'organization_id' (optional with default behavior). This adds meaningful context beyond the bare schema, though it could detail format constraints like length limits.

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

Purpose5/5

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

The description clearly states the action ('Create a new project') and resource ('in your QuantConnect organization'), making the purpose specific and unambiguous. It distinguishes from siblings like 'update_project' or 'read_project' by focusing on creation rather than modification or retrieval.

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 like 'update_project' or 'create_file', nor does it mention prerequisites such as authentication or organizational context. It lacks explicit when/when-not instructions or named alternatives.

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