Skip to main content
Glama

read_project

Retrieve specific project details by ID or list all available projects in the QuantConnect trading platform for strategy design and implementation.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler implementation for the 'read_project' MCP tool. Decorated with @mcp.tool(), it handles authentication, API calls to QuantConnect's 'projects/read' endpoint, and parses responses for single project or list of projects.
    @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,
            }
  • Top-level registration call to register_project_tools(mcp), which registers the read_project tool among other project management tools with the FastMCP server instance.
    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 and documentation defining the tool schema: input 'project_id' (Optional[int]), output Dict[str, Any].
    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
        """
Behavior3/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. It describes the read/list behavior and conditional logic based on the ID parameter, which is useful. However, it lacks details on permissions, rate limits, pagination for the list view, or error handling, leaving behavioral gaps for a tool with no annotation coverage.

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

Conciseness5/5

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

The description is well-structured and front-loaded with the core functionality in the first sentence. The 'Args' and 'Returns' sections are clear and efficient, with no wasted words. Every sentence adds value, making it easy to parse quickly.

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

Completeness4/5

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

Given no annotations, 0% schema coverage, but an output schema exists, the description is reasonably complete. It covers purpose, usage, parameter semantics, and return values. However, it could improve by addressing permissions or list pagination, though the output schema mitigates some gaps in return format details.

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 explains the 'project_id' parameter's semantics: optional, used to get specific details, and if omitted, returns a list. This adds crucial meaning beyond the schema's type/format, though it doesn't specify ID format constraints or list behavior details.

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 tool's purpose with specific verbs ('Read project details' and 'list all projects') and distinguishes it from siblings like 'create_project' or 'update_project'. It explicitly mentions the resource ('project') and scope ('by ID' or 'all projects'), making the purpose unambiguous.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: 'by ID or list all projects if no ID provided'. It distinguishes usage based on parameter presence, though it doesn't name alternatives (e.g., 'list_backtests' for other resources), which is acceptable given the clear conditional logic.

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