create_list
Create a new list in a ClickUp folder or space by specifying the container type, container ID, and list name.
Instructions
Create a new list in a ClickUp folder or space with the specified name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container_type | Yes | The type of container to create the list in | |
| container_id | Yes | The ID of the container to create the list in | |
| name | Yes | The name of the list |
Implementation Reference
- src/tools/task-tools.ts:299-329 (registration)Registration of the 'create_list' tool on the MCP server using server.tool(), with Zod schema for container_type, container_id, and name.
server.tool( 'create_list', 'Create a new list in a ClickUp folder or space with the specified name.', { container_type: z.enum(['folder', 'space']).describe('The type of container to create the list in'), container_id: z.string().describe('The ID of the container to create the list in'), name: z.string().describe('The name of the list') }, async ({ container_type, container_id, name }) => { try { let result; if (container_type === 'folder') { result = await listsClient.createListInFolder(container_id, { name }); } else if (container_type === 'space') { result = await listsClient.createFolderlessList(container_id, { name }); } else { throw new Error('Invalid container_type. Must be one of: folder, space'); } return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { console.error(`Error creating list in ${container_type}:`, error); return { content: [{ type: 'text', text: `Error creating list: ${error.message}` }], isError: true }; } } ); - src/tools/task-tools.ts:307-328 (handler)Handler function for 'create_list' that routes to listsClient.createListInFolder or listsClient.createFolderlessList based on container_type.
async ({ container_type, container_id, name }) => { try { let result; if (container_type === 'folder') { result = await listsClient.createListInFolder(container_id, { name }); } else if (container_type === 'space') { result = await listsClient.createFolderlessList(container_id, { name }); } else { throw new Error('Invalid container_type. Must be one of: folder, space'); } return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { console.error(`Error creating list in ${container_type}:`, error); return { content: [{ type: 'text', text: `Error creating list: ${error.message}` }], isError: true }; } } - src/tools/task-tools.ts:302-306 (schema)Zod schema defining input parameters: container_type (enum: 'folder'/'space'), container_id (string), name (string).
{ container_type: z.enum(['folder', 'space']).describe('The type of container to create the list in'), container_id: z.string().describe('The ID of the container to create the list in'), name: z.string().describe('The name of the list') }, - src/clickup-client/lists.ts:13-16 (helper)CreateListParams interface used for creating lists, containing the name property.
export interface CreateListParams { name: string; // ...other parameters for creating a list... } - src/clickup-client/lists.ts:56-58 (helper)createListInFolder method - sends POST request to /folder/{folderId}/list to create a list in a folder.
async createListInFolder(folderId: string, params: CreateListParams): Promise<List> { return this.client.post(`/folder/${folderId}/list`, params); }