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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the new Doc | |
| parent | Yes | Parent object | |
| visibility | No | Doc visibility (PUBLIC or PRIVATE), PRIVATE by default | |
| create_page | No | Whether to create a initial page (false by default) |
Implementation Reference
- src/controllers/docs.controller.ts:45-81 (handler)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) }], }; }, }));
- src/services/docs.service.ts:42-55 (helper)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), }); }
- src/models/types.ts:60-68 (schema)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); });