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
| Name | Required | Description | Default |
|---|---|---|---|
| access_level | Yes | Access level (10=Guest, 20=Reporter, 30=Developer, 40=Maintainer, 50=Owner) | |
| group_id | Yes | The ID or URL-encoded path of the group | |
| user_id | Yes | The 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); };
- src/utils/tools-data.ts:794-816 (schema)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'] } },
- src/utils/tool-registry.ts:68-68 (registration)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,
- src/utils/tool-registry.ts:17-17 (registration)Import of the usersGroupsHandlers module containing the addGroupMember handler.import * as usersGroupsHandlers from "../handlers/users-groups-handlers.js";