get_workspaces
Retrieve all workspaces available to the current user from the Clockify time tracking system for project organization and access management.
Instructions
Get all workspaces for the current user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:850-863 (handler)The main handler method for the 'get_workspaces' tool. It calls the Clockify API to retrieve all workspaces for the current user and returns a formatted text response listing the workspaces with their names and IDs.private async getWorkspaces() { const workspaces = await this.makeRequest("/workspaces"); return { content: [ { type: "text", text: `Found ${workspaces.length} workspace(s):\n${workspaces .map((w: Workspace) => `- ${w.name} (${w.id})`) .join("\n")}`, }, ], isError: false, }; }
- src/index.ts:262-268 (registration)Registration of the 'get_workspaces' tool in the tools list returned by ListToolsRequestSchema. Includes the tool name, description, and empty input schema (no parameters required).name: "get_workspaces", description: "Get all workspaces for the current user", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:724-725 (registration)Dispatch logic in the CallToolRequestSchema handler's switch statement that calls the getWorkspaces handler method when the tool is invoked.case "get_workspaces": return await this.getWorkspaces();
- src/index.ts:116-176 (schema)TypeScript interface defining the structure of Workspace objects returned by the Clockify API, used for typing in the handler function.interface Workspace { id: string; name: string; hourlyRate?: { amount: number; currency: 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"; }>; workspaceSettings: { timeRoundingInReports: boolean; onlyAdminsSeeBillableRates: boolean; onlyAdminsCreateProject: boolean; onlyAdminsSeeDashboard: boolean; defaultBillableProjects: boolean; lockTimeEntries?: string; round: { round: string; minutes: string; }; projectFavorites: boolean; canSeeTimeSheet: boolean; canSeeTracker: boolean; projectPickerSpecialFilter: boolean; forceProjects: boolean; forceTasks: boolean; forceTags: boolean; forceDescription: boolean; onlyAdminsSeeAllTimeEntries: boolean; onlyAdminsSeePublicProjectsEntries: boolean; trackTimeDownToSecond: boolean; projectGroupingLabel: string; adminOnlyPages: string[]; automaticLock?: { changeDay: string; dayOfMonth: number; firstDay: string; olderThanPeriod: string; olderThanValue: number; type: string; }; onlyAdminsCreateTag: boolean; onlyAdminsCreateTask: boolean; timeTrackingMode: string; isProjectPublicByDefault: boolean; }; imageUrl?: string; featureSubscriptionType?: string; }