delete_api_key
Remove an API key from a Coroot project to revoke access. This permanent action deletes the specified key string using the project ID.
Instructions
Delete an API key.
Removes an API key from the project. This action cannot be undone.
Args: project_id: Project ID key: The API key to delete (the actual key string)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| key | Yes |
Implementation Reference
- src/mcp_coroot/client.py:1197-1213 (handler)Core handler function in CorootClient that executes the deletion by sending a POST request to the Coroot API endpoint /api/project/{project_id}/api_keys with action='delete' and the key.async def delete_api_key(self, project_id: str, key: str) -> dict[str, Any]: """Delete an API key. Args: project_id: Project ID. key: The API key to delete. Returns: Success status. """ data = {"action": "delete", "key": key} response = await self._request( "POST", f"/api/project/{project_id}/api_keys", json=data, ) return self._parse_json_response(response)
- src/mcp_coroot/server.py:1576-1586 (registration)MCP tool registration using @mcp.tool() decorator, defines the tool schema via parameters (project_id: str, key: str) and docstring, thin wrapper calling the implementation.@mcp.tool() async def delete_api_key(project_id: str, key: str) -> dict[str, Any]: """Delete an API key. Removes an API key from the project. This action cannot be undone. Args: project_id: Project ID key: The API key to delete (the actual key string) """ return await delete_api_key_impl(project_id, key) # type: ignore[no-any-return]
- src/mcp_coroot/server.py:1567-1573 (handler)Server-side MCP tool handler implementation that calls the client.delete_api_key method and formats the success response.async def delete_api_key_impl(project_id: str, key: str) -> dict[str, Any]: """Delete an API key.""" await get_client().delete_api_key(project_id, key) return { "success": True, "message": "API key deleted successfully", }