Skip to main content
Glama
Leanware-io

ClickUp MCP Integration

by Leanware-io

get_spaces

Retrieve all workspace spaces from ClickUp to view and manage project organization.

Instructions

Get all spaces in the workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Defines the 'get_spaces' tool using defineTool, specifying name, description, empty input schema, and handler that calls spaceService.getSpaces() to fetch spaces and returns formatted JSON response.
    const getSpacesTool = defineTool((z) => ({ name: "get_spaces", description: "Get all spaces in the workspace", inputSchema: {}, handler: async (input) => { const response = await spaceService.getSpaces(); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }, }));
  • src/index.ts:19-19 (registration)
    Imports the getSpacesTool from space.controller for use in tool registration.
    import { getSpacesTool } from "./controllers/space.controller";
  • src/index.ts:38-38 (registration)
    Includes getSpacesTool in the array of tools to be registered with the MCP server.
    getSpacesTool,
  • src/index.ts:89-91 (registration)
    Loop that registers every tool in the tools array (including getSpacesTool) by calling server.tool with its properties.
    tools.forEach((tool) => { server.tool(tool.name, tool.description, tool.inputSchema, tool.handler); });
  • Implements the core logic to fetch spaces via ClickUp API request, used by the tool handler.
    async getSpaces() { return this.request<{ spaces: any[] }>(`/team/${this.workspaceId}/space`); }

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/Leanware-io/clickup-mcp-server'

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