iam_delete_api_key
Remove an API key from IBM Cloud by specifying its ID, revoking access.
Instructions
Delete an API key by its ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key_id | Yes | The ID of the API key to delete |
Implementation Reference
- src/tools/iam/index.ts:73-85 (handler)Tool handler for iam_delete_api_key - deletes an API key by its ID via the IAM Identity API.
// ─── iam_delete_api_key ─────────────────────────────────────── server.tool( "iam_delete_api_key", "Delete an API key by its ID", { api_key_id: z.string().describe("The ID of the API key to delete"), }, async ({ api_key_id }) => safeTool(async () => { assertWriteAllowed(config.allowWrite); await client.delete(`${iamIdentityBase}/apikeys/${api_key_id}`); return { message: `API key ${api_key_id} deleted successfully` }; }) ); - src/tools/iam/index.ts:77-79 (schema)Input schema for iam_delete_api_key - requires a single string parameter 'api_key_id'.
{ api_key_id: z.string().describe("The ID of the API key to delete"), }, - src/tools/iam/index.ts:73-85 (registration)Registration of the tool named 'iam_delete_api_key' on the MCP server within the registerIAMTools function.
// ─── iam_delete_api_key ─────────────────────────────────────── server.tool( "iam_delete_api_key", "Delete an API key by its ID", { api_key_id: z.string().describe("The ID of the API key to delete"), }, async ({ api_key_id }) => safeTool(async () => { assertWriteAllowed(config.allowWrite); await client.delete(`${iamIdentityBase}/apikeys/${api_key_id}`); return { message: `API key ${api_key_id} deleted successfully` }; }) );