db_delete_deployment
Remove a database deployment by providing its resource instance ID.
Instructions
Delete a database deployment
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance_id | Yes | Resource instance ID |
Implementation Reference
- src/tools/databases/index.ts:30-35 (handler)Handler function that executes the db_delete_deployment tool logic: checks write permission, sends a DELETE request to the IBM Cloud Resource Controller API for the given instance_id, and returns a success message.
server.tool("db_delete_deployment", "Delete a database deployment", { instance_id: z.string().describe("Resource instance ID"), }, async (p) => safeTool(async () => { w(); await client.delete(`${IBM_ENDPOINTS.RESOURCE_CONTROLLER}/resource_instances/${p.instance_id}`); return {message:"Database deployment deleted"}; })); - src/tools/databases/index.ts:31-32 (schema)Input schema for db_delete_deployment: requires a single 'instance_id' string parameter describing the resource instance ID.
instance_id: z.string().describe("Resource instance ID"), }, async (p) => safeTool(async () => { w(); - src/tools/databases/index.ts:30-35 (registration)Registration of the db_delete_deployment tool on the MCP server via server.tool(), within the registerDatabaseTools function.
server.tool("db_delete_deployment", "Delete a database deployment", { instance_id: z.string().describe("Resource instance ID"), }, async (p) => safeTool(async () => { w(); await client.delete(`${IBM_ENDPOINTS.RESOURCE_CONTROLLER}/resource_instances/${p.instance_id}`); return {message:"Database deployment deleted"}; })); - src/server.ts:65-66 (registration)The registerDatabaseTools function is called from createServer() in server.ts, which registers all database tools including db_delete_deployment.
registerDatabaseTools(server, client, config); console.error(` ✓ Databases (10 tools)`); - src/lib/utils.ts:14-18 (helper)Helper function assertWriteAllowed used by the handler to enforce read-only mode; throws WriteNotAllowedError if writes are disabled.
export function assertWriteAllowed(allowWrite: boolean): void { if (!allowWrite) { throw new WriteNotAllowedError(); } }