Skip to main content
Glama
jamesbrink

MCP Server for Coroot

list_projects

Retrieve all accessible projects from Coroot observability platform to view project IDs and names for authenticated users.

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main MCP tool handler for 'list_projects'. Decorated with @mcp.tool() for registration and executes the tool logic by calling the impl helper.
    @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]
  • Helper implementation that fetches projects via CorootClient and formats the success response with count and projects list.
    @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,
        }
  • CorootClient method that implements the actual API call to retrieve projects from the /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
  • Lazy client factory used by tool helpers to get the shared CorootClient instance.
    def get_client() -> CorootClient:
        """Get or create the client instance.
    
        Raises:
            ValueError: If no credentials are configured.
        """
        global _client
        if _client is None:
            try:
                _client = CorootClient()
            except ValueError as e:
                # Re-raise with more context
                raise ValueError(
                    "Coroot credentials not configured. "
                    "Please set COROOT_BASE_URL and either:\n"
                    "  - COROOT_USERNAME and COROOT_PASSWORD for automatic login\n"
                    "  - COROOT_SESSION_COOKIE for direct authentication\n"
                    "  - COROOT_API_KEY for data ingestion endpoints"
                ) from e
        return _client

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/jamesbrink/mcp-coroot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server