Skip to main content
Glama
ahmedselimmansor-ctrl

IBM Cloud MCP Server

iam_get_api_key

Retrieve detailed information about an IBM Cloud API key using its unique ID.

Instructions

Get details of a specific API key by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_key_idYesThe ID of the API key

Implementation Reference

  • The handler/registration for the iam_get_api_key tool. It accepts an api_key_id parameter and makes a GET request to the IAM Identity API endpoint /v1/apikeys/{api_key_id} to retrieve API key details. Uses safeTool for error handling.
    server.tool(
      "iam_get_api_key",
      "Get details of a specific API key by its ID",
      {
        api_key_id: z.string().describe("The ID of the API key"),
      },
      async ({ api_key_id }) => safeTool(async () => {
        return client.get(`${iamIdentityBase}/apikeys/${api_key_id}`);
      })
    );
  • Zod schema for the tool's input. Defines a single required parameter 'api_key_id' of type string.
    {
      api_key_id: z.string().describe("The ID of the API key"),
    },
  • Registration via server.tool() call. The tool is named 'iam_get_api_key' and is registered within the registerIAMTools function, which is called from src/server.ts.
    server.tool(
      "iam_get_api_key",
      "Get details of a specific API key by its ID",
      {
        api_key_id: z.string().describe("The ID of the API key"),
      },
      async ({ api_key_id }) => safeTool(async () => {
        return client.get(`${iamIdentityBase}/apikeys/${api_key_id}`);
      })
    );
  • The safeTool helper wraps the handler logic in try/catch, returning formatted success or error MCP 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);
      }
    }
  • The client.get() method used by the handler to make the authenticated GET request to the IAM Identity API.
    async get<T = unknown>(url: string, queryParams?: Record<string, string | number | boolean | undefined>): Promise<T> {
      return this.request<T>(url, { method: "GET", queryParams });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It states the verb and parameter but does not disclose any behavioral traits such as idempotency, authentication requirements, or whether it modifies state. It is minimal and does not add value beyond the tool name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no unnecessary words. It efficiently conveys the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the tool is simple with one parameter and no output schema, the description does not hint at what 'details' are returned. It is adequate but could be slightly more informative about the response.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers 100% of parameters with a clear description of 'api_key_id'. The tool description does not add additional meaning beyond what the schema already provides, so it meets the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get details'), the resource ('API key'), and the identifier ('by its ID'). It is specific and distinguishes this tool from siblings like iam_create_api_key or iam_list_api_keys.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. While the purpose implies it is for retrieving details of a specific key, there is no mention of when not to use it or any context about prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ahmedselimmansor-ctrl/IBM_cloud_MCP_SERVER'

If you have feedback or need assistance with the MCP directory API, please join our Discord server