list_api_keys
Retrieve all API keys and their metadata for a specified project on the MCP Server for Coroot, aiding in key management and observability integration.
Instructions
List all API keys for a project.
Returns all API keys with their metadata (but not the secret values).
Args: project_id: Project ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes |
Implementation Reference
- src/mcp_coroot/server.py:1524-1533 (registration)Registers the 'list_api_keys' MCP tool using the FastMCP @mcp.tool() decorator. The schema is inferred from the function signature (project_id: str) and docstring.@mcp.tool() async def list_api_keys(project_id: str) -> dict[str, Any]: """List all API keys for a project. Returns all API keys with their metadata (but not the secret values). Args: project_id: Project ID """ return await list_api_keys_impl(project_id) # type: ignore[no-any-return]
- src/mcp_coroot/server.py:1515-1522 (handler)Primary MCP tool handler that invokes CorootClient.list_api_keys(), applies error handling via @handle_errors decorator, and formats the success response.async def list_api_keys_impl(project_id: str) -> dict[str, Any]: """List API keys.""" keys = await get_client().list_api_keys(project_id) return { "success": True, "api_keys": keys, }
- src/mcp_coroot/client.py:1158-1169 (handler)CorootClient.list_api_keys method implementing the core logic: sends GET request to Coroot API endpoint /api/project/{project_id}/api_keys and returns parsed JSON response.async def list_api_keys(self, project_id: str) -> dict[str, Any]: """List API keys for a project. Args: project_id: Project ID. Returns: List of API keys. """ response = await self._request("GET", f"/api/project/{project_id}/api_keys") data: dict[str, Any] = response.json() return data