Skip to main content
Glama
Leanware-io

ClickUp MCP Integration

by Leanware-io

clickup_create_doc

Create a new document in ClickUp by specifying a name and parent location, with options to set visibility and include an initial page.

Instructions

Create a new doc in ClickUp

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the new Doc
parentYesParent object
visibilityNoDoc visibility (PUBLIC or PRIVATE), PRIVATE by default
create_pageNoWhether to create a initial page (false by default)

Implementation Reference

  • Defines the MCP tool 'clickup_create_doc' including its name, description, Zod input schema, and async handler function. The handler maps input to CreateDocParams, calls DocsService.createDoc, and returns a JSON-formatted response.
    const createDocTool = defineTool((z) => ({
      name: "clickup_create_doc",
      description: "Create a new doc in ClickUp",
      inputSchema: {
        name: z.string().describe("The name of the new Doc"),
        parent: z
          .object({
            id: z.string().describe("Parent ID"),
            type: z
              .number()
              .describe(
                "Parent type: 4 for Space, 5 for Folder, 6 for List, 7 for Everything, 12 for Workspace"
              ),
          })
          .describe("Parent object"),
        visibility: z
          .string()
          .optional()
          .describe("Doc visibility (PUBLIC or PRIVATE), PRIVATE by default"),
        create_page: z
          .boolean()
          .optional()
          .describe("Whether to create a initial page (false by default)"),
      },
      handler: async (input) => {
        const docParams: CreateDocParams = {
          name: input.name,
          parent: input.parent,
          visibility: input.visibility,
          create_page: input.create_page,
        };
        const response = await docsService.createDoc(docParams);
        return {
          content: [{ type: "text", text: JSON.stringify(response) }],
        };
      },
    }));
  • Core helper method in DocsService that handles the actual API interaction: prepares request data with defaults and performs POST to ClickUp's /workspaces/{workspaceId}/docs endpoint.
    async createDoc(params: CreateDocParams): Promise<ClickUpDoc> {
      const docData = {
        name: params.name,
        parent: params.parent,
        visibility: params.visibility || "PRIVATE",
        create_page:
          params.create_page !== undefined ? params.create_page : false,
      };
    
      return this.request<ClickUpDoc>(`/${this.workspaceId}/docs`, {
        method: "POST",
        body: JSON.stringify(docData),
      });
    }
  • TypeScript interface defining the input parameters for creating a ClickUp doc, used for type safety in the service and controller.
    export interface CreateDocParams {
      name: string;
      parent: {
        id: string;
        type: number; // 4 for Space, 5 for Folder, 6 for List, 7 for Everything, 12 for Workspace
      };
      visibility?: string; // "PRIVATE" by default
      create_page?: boolean; // false by default
    }
  • src/index.ts:55-62 (registration)
    Includes the createDocTool in the 'tools' array alongside other doc-related tools.
      // Docs tools
      searchDocsTool,
      createDocTool,
      getDocPagesTool,
      getPageTool,
      createPageTool,
      editPageTool,
    ];
  • src/index.ts:89-91 (registration)
    Loop that registers every tool in the 'tools' array (including clickup_create_doc) with the MCP server instance by calling server.tool().
    tools.forEach((tool) => {
      server.tool(tool.name, tool.description, tool.inputSchema, tool.handler);
    });

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