get_workspace_users
Retrieve all users within a specific workspace using the provided workspace ID. Enables efficient user management and integration with Clockify time tracking API.
Instructions
Get all users in a workspace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | Workspace ID |
Implementation Reference
- src/index.ts:270-279 (registration)Tool registration in the listTools response, including name, description, and input schema.name: "get_workspace_users", description: "Get all users in a workspace", inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, }, required: ["workspaceId"], }, },
- src/index.ts:727-729 (registration)Dispatch in CallToolRequestSchema handler that validates input and calls the getWorkspaceUsers method.if (!args?.workspaceId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId is required'); return await this.getWorkspaceUsers(args.workspaceId as string);
- src/index.ts:272-278 (schema)Input schema definition for the tool requiring workspaceId.inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, }, required: ["workspaceId"], },
- src/index.ts:865-878 (handler)The main handler function that makes an API request to Clockify to retrieve users in the specified workspace and returns a formatted text response listing the users.private async getWorkspaceUsers(workspaceId: string | undefined) { const users = await this.makeRequest(`/workspaces/${workspaceId}/users`); return { content: [ { type: "text", text: `Found ${users.length} user(s) in workspace:\n${users .map((u: User) => `- ${u.name} (${u.email}) - ${u.id}`) .join("\n")}`, }, ], isError: false, }; }