Skip to main content
Glama

gitlab_add_group_member

Add a user to a GitLab group with specified access level (Guest, Reporter, Developer, Maintainer, Owner) using group ID and user ID for effective permission management.

Instructions

Add a user to a group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
access_levelYesAccess level (10=Guest, 20=Reporter, 30=Developer, 40=Maintainer, 50=Owner)
group_idYesThe ID or URL-encoded path of the group
user_idYesThe ID of the user

Implementation Reference

  • The core handler function that implements the gitlab_add_group_member tool logic, extracting parameters and calling the usersGroupsManager to add a group member.
    /**
     * Add group member handler
     */
    export const addGroupMember: ToolHandler = async (params, context) => {
      const { group_id, user_id, access_level, expires_at } = params.arguments || {};
      if (!group_id || !user_id || !access_level) {
        throw new McpError(ErrorCode.InvalidParams, 'group_id, user_id, and access_level are required');
      }
      
      const data = await context.usersGroupsManager.addGroupMember(
        group_id as string | number,
        user_id as number,
        access_level as number,
        expires_at as string | undefined
      );
      return formatResponse(data);
    };
  • The input schema and description definition for the gitlab_add_group_member tool.
    {
      name: 'gitlab_add_group_member',
      description: 'Add a user to a group',
      inputSchema: {
        type: 'object',
        properties: {
          group_id: {
            type: 'string',
            description: 'The ID or URL-encoded path of the group'
          },
          user_id: {
            type: 'number',
            description: 'The ID of the user'
          },
          access_level: {
            type: 'number',
            description: 'Access level (10=Guest, 20=Reporter, 30=Developer, 40=Maintainer, 50=Owner)',
            enum: [10, 20, 30, 40, 50]
          }
        },
        required: ['group_id', 'user_id', 'access_level']
      }
    },
  • Registration of the gitlab_add_group_member tool in the central tool registry, mapping the tool name to its handler function.
    gitlab_add_group_member: usersGroupsHandlers.addGroupMember,
  • Import of the usersGroupsHandlers module containing the addGroupMember handler.
    import * as usersGroupsHandlers from "../handlers/users-groups-handlers.js";
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits such as required permissions (e.g., admin rights), whether this is idempotent, potential rate limits, error conditions (e.g., if user/group doesn't exist), or what happens on success (e.g., confirmation message). For a mutation tool with zero annotation coverage, this is a significant gap.

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, efficient sentence with zero wasted words. It's front-loaded with the core action, making it easy to parse quickly. Every word earns its place by conveying essential information without redundancy.

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

Completeness2/5

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

Given this is a mutation tool (adding a member) with no annotations and no output schema, the description is incomplete. It lacks information on permissions, error handling, success responses, and how it relates to sibling tools. For a tool that modifies group membership, more context is needed to use it effectively.

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%, with clear descriptions for all three parameters (group_id, user_id, access_level), including enum values for access_level. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

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

Purpose4/5

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

The description 'Add a user to a group' clearly states the action (add) and resource (user to group), making the purpose immediately understandable. It distinguishes from siblings like 'gitlab_add_project_member' by specifying 'group' rather than 'project'. However, it doesn't explicitly mention that this is for GitLab groups, though context from tool name and siblings implies this.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing admin permissions), when not to use it (e.g., for project-level membership), or refer to sibling tools like 'gitlab_list_group_members' for checking existing members. Usage is implied by the name but not explicitly stated.

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

Related 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/rifqi96/mcp-gitlab'

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