Skip to main content
Glama
jamesbrink

MCP Server for Coroot

create_api_key

Generate API keys for sending metrics and data to Coroot observability platform. The secret key is provided only once during creation.

Instructions

Create a new API key for data ingestion.

Creates an API key that can be used for sending metrics and data. The key secret is only returned once during creation.

Args: project_id: Project ID name: API key name description: Optional description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
nameYes
descriptionNo

Implementation Reference

  • The main MCP tool handler function for 'create_api_key', decorated with @mcp.tool(). It delegates to the internal implementation helper.
    @mcp.tool()
    async def create_api_key(
        project_id: str, name: str, description: str | None = None
    ) -> dict[str, Any]:
        """Create a new API key for data ingestion.
    
        Creates an API key that can be used for sending metrics and data.
        The key secret is only returned once during creation.
    
        Args:
            project_id: Project ID
            name: API key name
            description: Optional description
        """
        return await create_api_key_impl(project_id, name, description)  # type: ignore[no-any-return]
  • Internal helper function that handles errors and calls the CorootClient.create_api_key method.
    async def create_api_key_impl(
        project_id: str, name: str, description: str | None = None
    ) -> dict[str, Any]:
        """Create an API key."""
        result = await get_client().create_api_key(project_id, name, description)
        return {
            "success": True,
            "message": "API key created successfully",
            "api_key": result,
        }
  • CorootClient class method that performs the actual HTTP POST request to the Coroot API to generate a new API key.
    async def create_api_key(
        self, project_id: str, name: str, description: str | None = None
    ) -> dict[str, Any]:
        """Create a new API key.
    
        Args:
            project_id: Project ID.
            name: API key name (used as description in Coroot).
            description: Optional description (not used by Coroot).
    
        Returns:
            Created API key with secret.
        """
        # Coroot expects 'action' and 'description' fields
        data = {
            "action": "generate",
            "description": name,  # Coroot uses 'description' not 'name'
        }
    
        response = await self._request(
            "POST",
            f"/api/project/{project_id}/api_keys",
            json=data,
        )
        return self._parse_json_response(response)

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