ce_update_app
Update an IBM Cloud Code Engine application by modifying its image, port, or scaling settings.
Instructions
Update a Code Engine application
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| app_name | Yes | ||
| image_reference | No | ||
| image_port | No | ||
| scale_min | No | ||
| scale_max | No | ||
| region | No |
Implementation Reference
- src/tools/code-engine/index.ts:53-65 (handler)The handler function for ce_update_app. It builds a body object with optional fields (image_reference, image_port, scale_min/max) and sends a PATCH request to the Code Engine API to update an application.
server.tool("ce_update_app", "Update a Code Engine application", { project_id: z.string(), app_name: z.string(), image_reference: z.string().optional(), image_port: z.number().optional(), scale_min: z.number().optional(), scale_max: z.number().optional(), region: z.string().optional(), }, async (p) => safeTool(async () => { w(); const body: Record<string,unknown> = {}; if(p.image_reference) body.image_reference=p.image_reference; if(p.image_port) body.image_port=p.image_port; if(p.scale_min!==undefined) body.scale_min_instances=p.scale_min; if(p.scale_max!==undefined) body.scale_max_instances=p.scale_max; return client.patch(`${base(p.region||r)}/projects/${p.project_id}/apps/${p.app_name}`, body); })); - src/tools/code-engine/index.ts:54-57 (schema)Zod schema defining input parameters: project_id (required string), app_name (required string), image_reference (optional string), image_port (optional number), scale_min (optional number), scale_max (optional number), region (optional string).
project_id: z.string(), app_name: z.string(), image_reference: z.string().optional(), image_port: z.number().optional(), scale_min: z.number().optional(), scale_max: z.number().optional(), region: z.string().optional(), - src/tools/code-engine/index.ts:7-7 (registration)The export function registerCodeEngineTools that contains the server.tool registration for ce_update_app (and all other Code Engine tools).
export function registerCodeEngineTools(server: McpServer, client: IBMCloudAPIClient, config: ServerConfig) { - src/server.ts:62-62 (registration)Call to registerCodeEngineTools in the main server setup, which registers the ce_update_app tool among others.
registerCodeEngineTools(server, client, config);