Skip to main content
Glama

create_api_key

Generate an API key for data ingestion into the Coroot observability platform. Specify project ID and name to create a key for sending metrics and data securely. The key secret is provided only upon 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
descriptionNo
nameYes
project_idYes

Implementation Reference

  • Core implementation of create_api_key: sends POST request to Coroot API endpoint /api/project/{project_id}/api_keys with action=generate to create and return 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)
  • MCP tool handler wrapper: calls CorootClient.create_api_key and formats the success response with standardized structure.
    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, }
  • FastMCP tool registration: defines the create_api_key tool with input parameters, docstring schema, and delegates to implementation.
    @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]

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