get_user
Retrieve current user information from GitLab, providing access to account details and profile data through the GitLab MCP Server integration.
Instructions
Get current user information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/user.ts:6-17 (handler)Core implementation of the 'get_user' tool: fetches current user data from GitLab API endpoint '/user' and returns it as MCP-formatted text content 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 (registration)Registers the 'get_user' tool for MCP, defining its metadata, description, and input schema (no required parameters).export const userTools: Tool[] = [ { name: 'get_user', description: 'Get current user information', inputSchema: { type: 'object', properties: {}, }, }, ];
- src/tools/user.ts:7-10 (schema)Defines the input schema for 'get_user' tool as an empty object, indicating no parameters are needed.inputSchema: { type: 'object', properties: {}, },
- src/server.ts:265-266 (registration)Dispatches 'get_user' tool invocations to the corresponding handler method in the MCP server's central switch statement.case "get_user": return await this.userHandlers.getUser();
- src/tools/index.ts:8-17 (registration)Aggregates the userTools (including 'get_user') into the complete allTools list exposed to the MCP server.import { userTools } from './user.js'; export const allTools: Tool[] = [ ...projectTools, ...issueTools, ...mergeRequestTools, ...repositoryTools, ...pipelineTools, ...jobTools, ...userTools,