gitlab_add_project_member
Assign a user to a GitLab project with specified access level. Use this tool to manage project permissions by providing project ID, user ID, and access level (Guest, Reporter, Developer, Maintainer, Owner).
Instructions
Add a user to a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| access_level | Yes | Access level (10=Guest, 20=Reporter, 30=Developer, 40=Maintainer, 50=Owner) | |
| project_id | Yes | The ID or URL-encoded path of the project | |
| user_id | Yes | The ID of the user |
Implementation Reference
- The handler function that implements the core logic for the 'gitlab_add_project_member' tool. It validates required parameters (project_id, user_id, access_level) and calls the underlying usersGroupsManager to add the member.export const addProjectMember: ToolHandler = async (params, context) => { const { project_id, user_id, access_level, expires_at } = params.arguments || {}; if (!project_id || !user_id || !access_level) { throw new McpError(ErrorCode.InvalidParams, 'project_id, user_id, and access_level are required'); } const data = await context.usersGroupsManager.addProjectMember( project_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:831-853 (schema)The input schema definition for the 'gitlab_add_project_member' tool, specifying parameters like project_id, user_id, and access_level with types, descriptions, and required fields.{ name: 'gitlab_add_project_member', description: 'Add a user to a project', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'The ID or URL-encoded path of the project' }, 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: ['project_id', 'user_id', 'access_level'] } }
- src/utils/tool-registry.ts:70-70 (registration)Registration of the 'gitlab_add_project_member' tool in the central tool registry, mapping the tool name to its handler function usersGroupsHandlers.addProjectMember.gitlab_add_project_member: usersGroupsHandlers.addProjectMember