clickup_create_doc
Create new documents in ClickUp workspaces with specified parent locations and visibility settings to organize project documentation.
Instructions
Create a new doc in ClickUp
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| create_page | No | Whether to create a initial page (false by default) | |
| name | Yes | The name of the new Doc | |
| parent | Yes | Parent object | |
| visibility | No | Doc visibility (PUBLIC or PRIVATE), PRIVATE by default |
Implementation Reference
- src/controllers/docs.controller.ts:45-81 (registration)Registration of the 'clickup_create_doc' tool including name, Zod input schema, description, and handler function that delegates to DocsService.createDocconst 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 (handler)Core implementation of doc creation: prepares request data and makes POST API call to ClickUp /docs endpointasync 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/index.ts:56-61 (registration)Includes createDocTool in the array of tools to be registered to the MCP serversearchDocsTool, createDocTool, getDocPagesTool, getPageTool, createPageTool, editPageTool,
- src/models/types.ts:60-68 (schema)TypeScript interface defining the CreateDocParams used by the createDoc service methodexport 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/services/docs.service.ts:24-33 (helper)Helper request method used by createDoc to perform authenticated API calls to ClickUpprivate async request<T>( endpoint: string, options: RequestInit = {} ): Promise<T> { const response = await fetch(`${BASE_URL}${endpoint}`, { ...options, headers: this.headers, }); return response.json(); }