list_projects
Retrieve all projects accessible to the authenticated user, including project IDs and names, for managing and monitoring within the Coroot observability platform.
Instructions
List all accessible projects.
Returns a list of all projects that the authenticated user has access to. Each project includes its ID and name.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_coroot/server.py:152-159 (handler)The MCP tool handler function for 'list_projects', decorated with @mcp.tool(). This is the entry point executed when the tool is called.@mcp.tool() async def list_projects() -> dict[str, Any]: """List all accessible projects. Returns a list of all projects that the authenticated user has access to. Each project includes its ID and name. """ return await list_projects_impl() # type: ignore[no-any-return]
- src/mcp_coroot/server.py:140-150 (handler)The core implementation logic for the list_projects tool, which fetches projects using CorootClient and formats the response with success status and count.@handle_errors async def list_projects_impl() -> dict[str, Any]: """List all accessible projects.""" projects = await get_client().list_projects() return { "success": True, "count": len(projects), "projects": projects, }
- src/mcp_coroot/client.py:290-300 (helper)Helper method in CorootClient that implements the actual API call to retrieve projects from the Coroot server's /api/user endpoint.async def list_projects(self) -> list[dict[str, Any]]: """List all accessible projects. Returns: List of project dictionaries. """ # Get user info which includes projects list user_response = await self._request("GET", "/api/user") user_data: dict[str, Any] = user_response.json() projects: list[dict[str, Any]] = user_data.get("projects", []) return projects