db_list_backups
Lists all available backups for a specified IBM Cloud database deployment using its deployment ID and optional region.
Instructions
List backups for a database deployment
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deployment_id | Yes | ||
| region | No |
Implementation Reference
- src/tools/databases/index.ts:37-39 (registration)The tool 'db_list_backups' is registered on the MCP server using server.tool() with the name 'db_list_backups' and description 'List backups for a database deployment'.
server.tool("db_list_backups", "List backups for a database deployment", { deployment_id: z.string(), region: z.string().optional(), }, async (p) => safeTool(() => client.get(`${base(p.region||r)}/deployments/${encodeURIComponent(p.deployment_id)}/backups`))); - src/tools/databases/index.ts:38-38 (schema)Input schema for 'db_list_backups': requires a 'deployment_id' (z.string()) and optional 'region' (z.string().optional()).
deployment_id: z.string(), region: z.string().optional(), - src/tools/databases/index.ts:39-39 (handler)The handler performs a GET request to the IBM Cloud Databases API endpoint: `${base(p.region||r)}/deployments/${encodeURIComponent(p.deployment_id)}/backups`, wrapped in safeTool() for error handling. The base URL is constructed using IBM_ENDPOINTS.DATABASES (https://api.{region}.databases.cloud.ibm.com/v5/ibm).
}, async (p) => safeTool(() => client.get(`${base(p.region||r)}/deployments/${encodeURIComponent(p.deployment_id)}/backups`))); - src/lib/api-client.ts:128-130 (helper)The handler delegates to IBMCloudAPIClient.get() which makes an authenticated GET request to the provided URL with query parameters.
async get<T = unknown>(url: string, queryParams?: Record<string, string | number | boolean | undefined>): Promise<T> { return this.request<T>(url, { method: "GET", queryParams }); } - src/lib/utils.ts:70-77 (helper)The safeTool() wrapper catches errors and formats successful/failed responses into MCP content blocks.
export async function safeTool<T>(fn: () => Promise<T>): Promise<ReturnType<typeof successContent> | ReturnType<typeof errorContent>> { try { const result = await fn(); return successContent(result); } catch (error) { return errorContent(error); } }