db_get_scaling
Retrieve the current scaling configuration of a deployment, including group ID and region details.
Instructions
Get current scaling configuration for a deployment
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deployment_id | Yes | ||
| group_id | No | Group ID (default: member) | |
| region | No |
Implementation Reference
- src/tools/databases/index.ts:57-62 (handler)The handler function for 'db_get_scaling' tool that performs a GET request to the IBM Cloud Databases API endpoint to retrieve scaling configuration for a deployment group. It calls client.get() with the URL formed from the database base endpoint, deployment_id, and group_id (defaulting to 'member').
server.tool("db_get_scaling", "Get current scaling configuration for a deployment", { deployment_id: z.string(), group_id: z.string().optional().describe("Group ID (default: member)"), region: z.string().optional(), }, async (p) => safeTool(() => client.get(`${base(p.region||r)}/deployments/${encodeURIComponent(p.deployment_id)}/groups/${p.group_id||"member"}`) )); - src/tools/databases/index.ts:58-59 (schema)Zod schema defining the input parameters for 'db_get_scaling': deployment_id (required string), group_id (optional string, defaults to 'member'), and region (optional string).
deployment_id: z.string(), group_id: z.string().optional().describe("Group ID (default: member)"), region: z.string().optional(), - src/tools/databases/index.ts:57-62 (registration)Registration of 'db_get_scaling' tool via server.tool() in the registerDatabaseTools function, which is called from src/server.ts line 65.
server.tool("db_get_scaling", "Get current scaling configuration for a deployment", { deployment_id: z.string(), group_id: z.string().optional().describe("Group ID (default: member)"), region: z.string().optional(), }, async (p) => safeTool(() => client.get(`${base(p.region||r)}/deployments/${encodeURIComponent(p.deployment_id)}/groups/${p.group_id||"member"}`) )); - src/config.ts:54-55 (helper)The DATABASES endpoint helper in IBM_ENDPOINTS that constructs the base URL for the IBM Cloud Databases API (v5). Used by the tool to form the API request URL.
DATABASES: (region: string) => `https://api.${region}.databases.cloud.ibm.com/v5/ibm`, - src/lib/utils.ts:70-77 (helper)The safeTool helper that wraps the handler logic, catching errors and returning proper MCP success/error 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); } }