delete_api_key
Remove and deactivate an API key from a project in the MCP Server for Coroot to enhance security and manage access effectively. Requires project ID and the key string. Action is irreversible.
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 |
|---|---|---|---|
| key | Yes | ||
| project_id | Yes |
Implementation Reference
- src/mcp_coroot/server.py:1576-1587 (handler)MCP tool handler function decorated with @mcp.tool() that implements the delete_api_key tool by delegating to the internal impl function.@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/client.py:1197-1213 (helper)CorootClient.delete_api_key method that makes the HTTP POST request to Coroot API to delete the specified API 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:1567-1574 (helper)Internal implementation function wrapped with error handling that calls the client method and formats the 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", }
- src/mcp_coroot/server.py:1576-1576 (registration)The @mcp.tool() decorator registers the delete_api_key function as an MCP tool.@mcp.tool()