get_workspaces
List all accessible ClickUp workspaces, returning IDs, names, and metadata for the authenticated user.
Instructions
Get a list of all ClickUp workspaces accessible to the authenticated user. Returns workspace IDs, names, and metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/task-tools.ts:38-56 (handler)The MCP tool handler for 'get_workspaces'. Registered with server.tool(), calls authClient.getWorkspaces() and returns the result as JSON text content.
server.tool( 'get_workspaces', 'Get a list of all ClickUp workspaces accessible to the authenticated user. Returns workspace IDs, names, and metadata.', {}, async () => { try { const result = await authClient.getWorkspaces(); return { content: [{ type: 'text', text: JSON.stringify(result.teams, null, 2) }] }; } catch (error: any) { console.error('Error getting workspaces:', error); return { content: [{ type: 'text', text: `Error getting workspaces: ${error.message}` }], isError: true }; } } ); - src/tools/task-tools.ts:38-56 (registration)Tool registration via server.tool('get_workspaces', description, empty schema {}, async handler). The setupTaskTools function registers this tool on the McpServer.
server.tool( 'get_workspaces', 'Get a list of all ClickUp workspaces accessible to the authenticated user. Returns workspace IDs, names, and metadata.', {}, async () => { try { const result = await authClient.getWorkspaces(); return { content: [{ type: 'text', text: JSON.stringify(result.teams, null, 2) }] }; } catch (error: any) { console.error('Error getting workspaces:', error); return { content: [{ type: 'text', text: `Error getting workspaces: ${error.message}` }], isError: true }; } } ); - src/tools/task-tools.ts:41-41 (schema)Input schema for 'get_workspaces' — an empty object {} (no parameters required).
{}, - src/clickup-client/auth.ts:53-60 (helper)The underlying getWorkspaces() method on AuthClient. Calls the ClickUp API GET /team endpoint to fetch all workspaces (teams) accessible to the authenticated user. Returns { teams: Workspace[] }.
async getWorkspaces(): Promise<{ teams: Workspace[] }> { try { return await this.client.get('/team'); } catch (error) { console.error('Error getting workspaces:', error); throw error; } } - src/clickup-client/auth.ts:11-27 (helper)Workspace interface definition: id, name, color, avatar, and members array with user info and role.
export interface Workspace { id: string; name: string; color: string; avatar: string; members: Array<{ user: { id: number; username: string; email: string; color: string; profilePicture: string; }; role: number; custom_role?: string; }>; }