Skip to main content
Glama
ahmedselimmansor-ctrl

IBM Cloud MCP Server

iam_add_member_to_group

Add an IAM user or service ID to an access group to grant permissions.

Instructions

Add a member (user or service ID) to an access group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
access_group_idYesID of the access group
iam_idYesIAM ID of the member to add
typeYesType of member

Implementation Reference

  • Tool registration: 'iam_add_member_to_group' is registered via server.tool() with name, description, schema, and handler.
    // ─── iam_add_member_to_group ──────────────────────────────────
    server.tool(
      "iam_add_member_to_group",
      "Add a member (user or service ID) to an access group",
      {
        access_group_id: z.string().describe("ID of the access group"),
        iam_id: z.string().describe("IAM ID of the member to add"),
        type: z.enum(["user", "service"]).describe("Type of member"),
      },
      async ({ access_group_id, iam_id, type }) => safeTool(async () => {
        assertWriteAllowed(config.allowWrite);
        return client.put(`${IBM_ENDPOINTS.IAM_ACCESS_GROUPS}/groups/${access_group_id}/members`, {
          members: [{ iam_id, type }],
        });
      })
    );
  • Handler function: Makes a PUT request to IBM IAM Access Groups API to add a member to an access group. Wraps logic in safeTool() and checks assertWriteAllowed().
    async ({ access_group_id, iam_id, type }) => safeTool(async () => {
      assertWriteAllowed(config.allowWrite);
      return client.put(`${IBM_ENDPOINTS.IAM_ACCESS_GROUPS}/groups/${access_group_id}/members`, {
        members: [{ iam_id, type }],
      });
    })
  • Input schema: Defines three parameters - access_group_id (string), iam_id (string), and type (enum: user/service).
    {
      access_group_id: z.string().describe("ID of the access group"),
      iam_id: z.string().describe("IAM ID of the member to add"),
      type: z.enum(["user", "service"]).describe("Type of member"),
    },
  • src/server.ts:50-50 (registration)
    Top-level registration: registerIAMTools() is called in server.ts to register all IAM tools including this one.
    registerIAMTools(server, client, config);
  • safeTool helper: Wraps handler execution in try/catch, returning success/error content for MCP responses.
    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);
      }
    }
Behavior2/5

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

No annotations are provided, so the description must carry full behavioral transparency. It only states the action without disclosing side effects, permissions required, or what happens if the member already exists. This is minimal.

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, concise sentence with no wasted words. It is front-loaded and efficient.

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?

No output schema and no annotations. The description does not cover return values or error conditions. For a simple mutation tool, it is adequate but not fully comprehensive.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds no extra meaning beyond the schema; it simply restates 'user or service ID' which is already in the parameter descriptions.

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 identifies the action ('Add a member') and the resource ('access group'), specifying the verb and resource. It distinguishes from sibling IAM tools like create/delete/list access groups.

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

Usage Guidelines3/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. For example, it does not mention that to create a new group one should use iam_create_access_group. The usage is somewhat implied but not clarified.

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