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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"api_key_id": "<api_key_id>"
},
"name": "iam_delete_api_key"
}
}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` }; }) );