get_current_user
Retrieve details about the current user in Clockify, enabling streamlined access to user-specific data for time tracking, project management, and reporting integrations.
Instructions
Get information about the current user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:837-848 (handler)The main handler function for the 'get_current_user' tool. It calls the Clockify API endpoint '/user' to fetch the current user's details and returns a formatted text response with name, email, active workspace, and user ID.private async getCurrentUser() { const user = await this.makeRequest("/user"); return { content: [ { type: "text", text: `Current user: ${user.name} (${user.email})\nActive Workspace: ${user.activeWorkspace}\nUser ID: ${user.id}`, }, ], isError: false, }; }
- src/index.ts:722-723 (registration)Registers the tool handler dispatch within the CallToolRequestSchema switch statement, routing calls to the getCurrentUser method.case "get_current_user": return await this.getCurrentUser();
- src/index.ts:253-260 (schema)Defines the tool schema in the ListTools response, specifying the name, description, and empty input schema (no parameters required).{ name: "get_current_user", description: "Get information about the current user", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:58-114 (schema)TypeScript interface defining the structure of the User object returned by the Clockify API, used in the handler.interface User { id: string; email: string; name: string; memberships: Array<{ userId: string; hourlyRate?: { amount: number; currency: string; }; costRate?: { amount: number; currency: string; }; targetId: string; membershipType: "WORKSPACE" | "PROJECT"; membershipStatus: "PENDING" | "ACTIVE" | "DECLINED" | "INACTIVE"; }>; profilePicture?: string; activeWorkspace: string; defaultWorkspace: string; settings: { weekStart: string; timeZone: string; timeFormat: string; dateFormat: string; sendNewsletter: boolean; weeklyUpdates: boolean; longRunning: boolean; timeTrackingManual: boolean; summaryReportSettings: { group: string; subgroup: string; }; isCompactViewOn: boolean; dashboardSelection: string; dashboardViewType: string; dashboardPinToTop: boolean; projectListCollapse: number; collapseAllProjectLists: boolean; groupSimilarEntriesDisabled: boolean; myStartOfDay: string; projectPickerTaskFilter: boolean; lang: string; multiFactorEnabled: boolean; theme: string; scheduling: boolean; onboarding: boolean; pto: boolean; }; status: string; customFields: Array<{ customFieldId: string; sourceType: string; value: string; }>; }