cf_get_app
Retrieves details for a Cloud Foundry application by providing its app GUID.
Instructions
Get Cloud Foundry application details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_guid | Yes |
Implementation Reference
- src/tools/cloud-foundry/index.ts:15-17 (handler)The handler function for 'cf_get_app'. It executes an HTTP GET request to the IBM Cloud Foundry API endpoint /v3/apps/{app_guid} using the client's get() method, wrapped in safeTool() for error handling.
server.tool("cf_get_app", "Get Cloud Foundry application details", { app_guid: z.string(), }, async (p) => safeTool(() => client.get(`${base}/v3/apps/${p.app_guid}`))); - The input schema for 'cf_get_app'. It defines a single required parameter 'app_guid' of type string (Zod schema) for specifying the Cloud Foundry application GUID.
server.tool("cf_get_app", "Get Cloud Foundry application details", { app_guid: z.string(), }, async (p) => safeTool(() => client.get(`${base}/v3/apps/${p.app_guid}`))); - src/tools/cloud-foundry/index.ts:15-17 (registration)Registration of 'cf_get_app' tool via server.tool() with name 'cf_get_app', description 'Get Cloud Foundry application details', and the schema + handler.
server.tool("cf_get_app", "Get Cloud Foundry application details", { app_guid: z.string(), }, async (p) => safeTool(() => client.get(`${base}/v3/apps/${p.app_guid}`))); - src/tools/cloud-foundry/index.ts:7-7 (registration)The registerCloudFoundryTools function is exported and invoked from src/server.ts (line 89) to register all Cloud Foundry tools including 'cf_get_app'.
export function registerCloudFoundryTools(server: McpServer, client: IBMCloudAPIClient, config: ServerConfig) { - src/lib/utils.ts:70-78 (helper)The safeTool() helper wraps the handler's async function, catching errors and formatting responses as MCP text 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); } }