get_project_list
Retrieve all projects from the Vibe system. Optionally filter by environment to scope the list.
Instructions
Retrieve all projects from the Vibe system
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_project_list"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | No | Development |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- app/tools/vibe_tools.py:281-298 (handler)The _execute_get_project_list method is the core handler that executes the get_project_list tool logic. It extracts the 'environment' parameter, calls vibe_client.get_project_list(), and returns a JSON-formatted TextContent result.
async def _execute_get_project_list( self, tool_input: dict[str, Any], log: structlog.stdlib.BoundLogger, ) -> list[TextContent]: """Execute get_project_list tool.""" environment = tool_input.get("environment", "Development") response = await self.vibe_client.get_project_list(environment=environment) result = { "status": "success", "data": response.model_dump(), "project_count": len(response.projects), } log.info("Tool executed successfully", result=result) return [TextContent(type="text", text=json.dumps(result, indent=2))] - app/services/vibe_api.py:60-108 (handler)The VibeAPIClient.get_project_list method is the service-level handler that performs the actual API call to GET /api/Project/GetProjectList, validates the request using GetProjectListRequest, normalizes the response, and returns a GetProjectListResponse.
async def get_project_list( self, environment: str = "Development", ) -> GetProjectListResponse: """ Get list of all projects. Args: environment: Environment name (production, development, etc.) Returns: GetProjectListResponse with list of projects Raises: MCPToolExecutionError: If API call fails """ log = self.logger.bind( method="get_project_list", environment=environment, ) try: # Create request object (validates input) request = GetProjectListRequest(environment=environment) log.debug("Fetching project list", request=request.model_dump()) # Make API call response_data = await self.http_client.get( endpoint=API_ENDPOINTS["GET_PROJECT_LIST"], params={"environment": request.environment}, ) # Validate and transform response. The Vibe API currently returns a # bare project array, while older docs showed a wrapped object. response = GetProjectListResponse( **self._normalize_project_list_response(response_data) ) log.debug( "Project list retrieved successfully", project_count=len(response.projects), ) return response except Exception as e: log.error("Failed to get project list", error=str(e)) raise MCPToolExecutionError( f"Failed to retrieve project list: {str(e)}" ) from e - app/tools/registration.py:24-38 (registration)The @mcp.tool decorator registers 'get_project_list' as a FastMCP tool with name='get_project_list' and description='Retrieve all projects from the Vibe system'. The wrapper function extracts the 'environment' parameter and delegates to VibeMCPTools._execute_get_project_list.
@mcp.tool( name="get_project_list", description="Retrieve all projects from the Vibe system", ) async def get_project_list(environment: str = "Development") -> str: try: result = await _tools()._execute_get_project_list( {"environment": environment}, logger.bind(tool="get_project_list"), ) return result[0].text except Exception as e: log = logger.bind(tool="get_project_list") log.error("Tool execution failed", error=str(e)) raise MCPToolExecutionError(f"Tool execution failed: {str(e)}") from e - app/models/project.py:13-22 (schema)GetProjectListRequest: Pydantic model for input validation with an 'environment' field (default='Development').
class GetProjectListRequest(BaseModel): """Request model for GetProjectList endpoint.""" model_config = ConfigDict(extra="forbid") environment: str = Field( default="Development", description="Environment (production, development, etc.)", ) - app/models/project.py:64-73 (schema)GetProjectListResponse: Pydantic model for response validation with 'success' (bool) and 'projects' (list of ProjectDto) fields.
class GetProjectListResponse(BaseModel): """Response model for GetProjectList endpoint.""" model_config = ConfigDict(extra="allow") success: bool = Field(description="Success indicator") projects: list[ProjectDto] = Field( default_factory=list, description="List of projects", )