Skip to main content
Glama

get_spaces

Retrieve all spaces from a ClickUp workspace. Returns space details including name, settings, and features.

Instructions

Get spaces from a ClickUp workspace. Returns space details including name, settings, and features.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idYesThe ID of the workspace to get spaces from

Implementation Reference

  • The handler function for the 'get_spaces' tool. Registers the tool with name 'get_spaces', accepts workspace_id parameter, calls spacesClient.getSpacesFromWorkspace, and returns the spaces as JSON.
    // Register get_spaces tool
    server.tool(
      'get_spaces',
      'Get spaces from a ClickUp workspace. Returns space details including name, settings, and features.',
      { workspace_id: z.string().describe('The ID of the workspace to get spaces from') },
      async ({ workspace_id }) => {
        try {
          console.error(`[SpaceTools] Getting spaces for workspace ${workspace_id}...`);
          const spaces = await spacesClient.getSpacesFromWorkspace(workspace_id);
          console.error(`[SpaceTools] Got ${spaces.length} spaces`);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(spaces, null, 2) }]
          };
        } catch (error: any) {
          console.error('Error getting spaces:', error);
          return {
            content: [{ type: 'text', text: `Error getting spaces: ${error.message}` }],
            isError: true
          };
        }
      }
    );
  • Input schema for get_spaces: workspace_id (string) required parameter.
    { workspace_id: z.string().describe('The ID of the workspace to get spaces from') },
  • Tool registration using server.tool() with name 'get_spaces'. The setupSpaceTools function is called from src/index.ts line 44.
    // Register get_spaces tool
    server.tool(
      'get_spaces',
      'Get spaces from a ClickUp workspace. Returns space details including name, settings, and features.',
      { workspace_id: z.string().describe('The ID of the workspace to get spaces from') },
      async ({ workspace_id }) => {
        try {
          console.error(`[SpaceTools] Getting spaces for workspace ${workspace_id}...`);
          const spaces = await spacesClient.getSpacesFromWorkspace(workspace_id);
          console.error(`[SpaceTools] Got ${spaces.length} spaces`);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(spaces, null, 2) }]
          };
        } catch (error: any) {
          console.error('Error getting spaces:', error);
          return {
            content: [{ type: 'text', text: `Error getting spaces: ${error.message}` }],
            isError: true
          };
        }
      }
    );
  • Helper client method getSpacesFromWorkspace that makes the actual API call to GET /team/{workspaceId}/space and returns the spaces array.
    async getSpacesFromWorkspace(workspaceId: string): Promise<Space[]> {
      // Use the v2 API endpoint for spaces
      const response = await this.client.get(`/team/${workspaceId}/space`);
      return response.spaces;
    }
  • AuthClient.getSpaces method - an alternate client method (unused by the tool directly) that also calls GET /team/{workspaceId}/space and includes a detailed response type definition for space objects.
    async getSpaces(workspaceId: string): Promise<{ spaces: Array<{
      id: string;
      name: string;
      private: boolean;
      statuses: Array<{
        id: string;
        status: string;
        type: string;
        orderindex: number;
        color: string;
      }>;
      multiple_assignees: boolean;
      features: {
        due_dates: {
          enabled: boolean;
          start_date: boolean;
          remap_due_dates: boolean;
          remap_closed_due_date: boolean;
        };
        time_tracking: {
          enabled: boolean;
        };
        tags: {
          enabled: boolean;
        };
        time_estimates: {
          enabled: boolean;
        };
        checklists: {
          enabled: boolean;
        };
        custom_fields: {
          enabled: boolean;
        };
        remap_dependencies: {
          enabled: boolean;
        };
        dependency_warning: {
          enabled: boolean;
        };
        portfolios: {
          enabled: boolean;
        };
      };
    }> }> {
      try {
        return await this.client.get(`/team/${workspaceId}/space`);
      } catch (error) {
        console.error('Error getting spaces:', error);
        throw error;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description carries full burden. It states it returns details but does not disclose if read-only, any rate limits, error handling, or pagination behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with purpose first. Efficient but no additional structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, so description should explain return values. High-level overview given, but lacks details on pagination, errors, or edge cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has one param with description (100% coverage). Description adds minor value by noting return details (name, settings, features) but does not enhance parameter understanding beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the verb 'Get' and the resource 'spaces from a ClickUp workspace'. Differentiates from sibling tools like 'get_space' (singular) and other tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when or when-not to use. Implicitly, it's for listing all spaces in a workspace, but no alternatives or exclusions mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nsxdavid/clickup-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server