iam_get_service_id
Retrieve details of a specific service ID in IBM Cloud IAM. Provide the UUID to get its configuration and metadata.
Instructions
Get details of a specific service ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service_id | Yes | The ID of the service ID (UUID) |
Implementation Reference
- src/tools/iam/index.ts:113-116 (handler)The handler function that executes the 'iam_get_service_id' tool logic. It takes a 'service_id' parameter and makes a GET request to the IAM Identity API endpoint '/v1/serviceids/{service_id}' to retrieve details of a specific service ID.
async ({ service_id }) => safeTool(async () => { return client.get(`${iamIdentityBase}/serviceids/${service_id}`); }) ); - src/tools/iam/index.ts:110-112 (schema)Input schema for the 'iam_get_service_id' tool. Defines a single required parameter 'service_id' (string UUID) for identifying the service ID to retrieve.
{ service_id: z.string().describe("The ID of the service ID (UUID)"), }, - src/tools/iam/index.ts:107-116 (registration)Registration of the 'iam_get_service_id' tool via server.tool(), with its name, description, schema, and handler function. Part of the registerIAMTools() function called from server.ts.
server.tool( "iam_get_service_id", "Get details of a specific service ID", { service_id: z.string().describe("The ID of the service ID (UUID)"), }, async ({ service_id }) => safeTool(async () => { return client.get(`${iamIdentityBase}/serviceids/${service_id}`); }) ); - src/lib/utils.ts:70-77 (helper)The safeTool helper wraps the handler logic to catch errors and return proper MCP response format (success or error content).
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/config.ts:28-28 (helper)The IAM_IDENTITY endpoint constant used to build the API URL for the 'iam_get_service_id' tool (resolves to 'https://iam.cloud.ibm.com/v1/serviceids/{service_id}').
IAM_IDENTITY: "https://iam.cloud.ibm.com/v1",