catalog_get_service
Retrieve detailed information about a specific IBM Cloud catalog service using its unique service ID.
Instructions
Get details of a specific catalog service by ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service_id | Yes | Catalog service ID |
Implementation Reference
- src/tools/catalog/index.ts:15-17 (handler)The handler for 'catalog_get_service' tool. It performs a GET request to the Global Catalog API base URL with the service_id appended, returning details of the specified catalog service.
server.tool("catalog_get_service", "Get details of a specific catalog service by ID", { service_id: z.string().describe("Catalog service ID"), }, async (p) => safeTool(() => client.get(`${base}/${p.service_id}`))); - src/tools/catalog/index.ts:15-17 (schema)The schema for 'catalog_get_service' defines a single required input parameter: 'service_id' (string, describing the catalog service ID). No output schema is explicitly defined; the response is the raw JSON from the API wrapped by safeTool.
server.tool("catalog_get_service", "Get details of a specific catalog service by ID", { service_id: z.string().describe("Catalog service ID"), }, async (p) => safeTool(() => client.get(`${base}/${p.service_id}`))); - src/tools/catalog/index.ts:7-22 (registration)The 'registerCatalogTools' function registers three catalog tools on the MCP server, including 'catalog_get_service'. It is called from src/server.ts (line 92) during server initialization.
export function registerCatalogTools(server: McpServer, client: IBMCloudAPIClient, _config: ServerConfig) { const base = IBM_ENDPOINTS.GLOBAL_CATALOG; server.tool("catalog_search_services", "Search the IBM Cloud global catalog for services and offerings", { query: z.string().describe("Search query (e.g. 'kubernetes', 'database')"), limit: z.number().optional(), }, async (p) => safeTool(() => client.get(base, {q:p.query,limit:p.limit||50,complete:true}))); server.tool("catalog_get_service", "Get details of a specific catalog service by ID", { service_id: z.string().describe("Catalog service ID"), }, async (p) => safeTool(() => client.get(`${base}/${p.service_id}`))); server.tool("catalog_list_plans", "List pricing plans for a catalog service", { service_id: z.string().describe("Catalog service ID"), }, async (p) => safeTool(() => client.get(`${base}/${p.service_id}/children`, {kind:"plan"}))); } - src/lib/utils.ts:70-77 (helper)The 'safeTool' helper wraps async handler functions to catch errors and return standardized MCP success/error content blocks. It is used as a wrapper around the API call in the handler.
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); } } - src/lib/api-client.ts:128-130 (helper)The 'get' method of IBMCloudAPIClient performs an authenticated GET request to the given URL. It is called by the handler to fetch catalog service details from the Global Catalog API.
async get<T = unknown>(url: string, queryParams?: Record<string, string | number | boolean | undefined>): Promise<T> { return this.request<T>(url, { method: "GET", queryParams }); }