get_current_user
Retrieve the authenticated user's profile and permissions from Harvest time tracking to verify access and manage time entries.
Instructions
Retrieve the currently authenticated user's profile and permissions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/users.ts:58-73 (handler)The GetCurrentUserHandler class implements the tool handler logic for 'get_current_user', which calls the Harvest API to retrieve the current user's profile.
class GetCurrentUserHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { logger.info('Fetching current user from Harvest API'); const user = await this.config.harvestClient.getCurrentUser(); return { content: [{ type: 'text', text: JSON.stringify(user, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'get_current_user'); } } } - src/tools/users.ts:165-176 (registration)Registration definition for the 'get_current_user' tool within the registerUserTools function.
{ tool: { name: 'get_current_user', description: 'Retrieve the currently authenticated user\'s profile and permissions.', inputSchema: { type: 'object', properties: {}, additionalProperties: false, }, }, handler: new GetCurrentUserHandler(config), },