get_user
Retrieve current user details from GitLab to verify identity and access permissions for GitLab projects, issues, and pipelines.
Instructions
Get current user information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/user.ts:6-17 (handler)The `getUser` method in the `UserHandlers` class that executes the core logic of the `get_user` tool: fetches current user data from the GitLab API and returns it as a text content block with JSON stringification.async getUser() { const data = await this.client.get('/user'); return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; }
- src/tools/user.ts:3-12 (schema)Defines the `get_user` tool schema, including name, description, and empty input schema (no parameters required).export const userTools: Tool[] = [ { name: 'get_user', description: 'Get current user information', inputSchema: { type: 'object', properties: {}, }, }, ];
- src/server.ts:265-266 (registration)Registers the handler dispatch for the `get_user` tool call within the MCP server's `CallToolRequestSchema` switch statement.case "get_user": return await this.userHandlers.getUser();
- src/server.ts:140-144 (registration)Registers the list_tools handler which returns `allTools` (including `get_user` via aggregation in tools/index.ts).this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });