update_folder
Modify existing ClickUp folder properties like name or status settings to organize workspace tasks effectively.
Instructions
Modify an existing folder's properties. Valid parameter combinations:
Use folderId alone (preferred)
Use folderName + (spaceId or spaceName)
At least one update field (name or override_statuses) must be provided.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folderId | No | ID of folder to update (preferred). Use this instead of folderName if you have it. | |
| folderName | No | Name of folder to update. When using this, you MUST also provide spaceId or spaceName. | |
| spaceId | No | ID of space containing the folder (required with folderName). Use this instead of spaceName if you have it. | |
| spaceName | No | Name of space containing the folder (required with folderName). Only use if you don't have spaceId. | |
| name | No | New name for the folder | |
| override_statuses | No | Whether to override space statuses with folder-specific statuses |
Implementation Reference
- src/tools/folder.ts:285-353 (handler)The handler function that implements the core logic for the 'update_folder' tool. It resolves the target folder ID (using lookups if name-based), validates inputs, constructs update data, invokes the folder service, and returns a formatted response.export async function handleUpdateFolder(parameters: any) { const { folderId, folderName, name, override_statuses, spaceId, spaceName } = parameters; let targetFolderId = folderId; // If no folderId provided but folderName is, look up the folder ID if (!targetFolderId && folderName) { let targetSpaceId = spaceId; // If no spaceId provided but spaceName is, look up the space ID first if (!targetSpaceId && spaceName) { const spaceIdResult = await workspaceService.findSpaceByName(spaceName); if (!spaceIdResult) { throw new Error(`Space "${spaceName}" not found`); } targetSpaceId = spaceIdResult.id; } if (!targetSpaceId) { throw new Error("Either spaceId or spaceName must be provided when using folderName"); } const folderResult = await folderService.findFolderByName(targetSpaceId, folderName); if (!folderResult) { throw new Error(`Folder "${folderName}" not found in space`); } targetFolderId = folderResult.id; } if (!targetFolderId) { throw new Error("Either folderId or folderName must be provided"); } // Ensure at least one update field is provided if (!name && override_statuses === undefined) { throw new Error("At least one of name or override_statuses must be provided for update"); } // Prepare update data const updateData: Partial<CreateFolderData> = {}; if (name) updateData.name = name; if (override_statuses !== undefined) updateData.override_statuses = override_statuses; try { // Update the folder const updatedFolder = await folderService.updateFolder(targetFolderId, updateData); return { content: [{ type: "text", text: JSON.stringify( { id: updatedFolder.id, name: updatedFolder.name, space: { id: updatedFolder.space.id, name: updatedFolder.space.name }, message: `Folder "${updatedFolder.name}" updated successfully` }, null, 2 ) }] }; } catch (error: any) { throw new Error(`Failed to update folder: ${error.message}`); } }
- src/tools/folder.ts:87-120 (schema)The tool schema defining the name 'update_folder', description, and inputSchema for parameter validation.export const updateFolderTool = { name: "update_folder", description: "Modify an existing folder's properties. Valid parameter combinations:\n1. Use folderId alone (preferred)\n2. Use folderName + (spaceId or spaceName)\n\nAt least one update field (name or override_statuses) must be provided.", inputSchema: { type: "object", properties: { folderId: { type: "string", description: "ID of folder to update (preferred). Use this instead of folderName if you have it." }, folderName: { type: "string", description: "Name of folder to update. When using this, you MUST also provide spaceId or spaceName." }, spaceId: { type: "string", description: "ID of space containing the folder (required with folderName). Use this instead of spaceName if you have it." }, spaceName: { type: "string", description: "Name of space containing the folder (required with folderName). Only use if you don't have spaceId." }, name: { type: "string", description: "New name for the folder" }, override_statuses: { type: "boolean", description: "Whether to override space statuses with folder-specific statuses" } }, required: [] } };
- src/server.ts:138-139 (registration)Registers the tool dispatch: routes 'update_folder' calls to the handleUpdateFolder handler in the MCP server request handler.case "update_folder": return handleUpdateFolder(params);
- src/server.ts:88-91 (registration)Includes updateFolderTool in the list of available tools returned by the listTools MCP endpoint.getFolderTool, updateFolderTool, deleteFolderTool ]
- Helper service method invoked by the handler to perform the actual ClickUp API updateFolder call via HTTP PUT.async updateFolder(folderId: string, updateData: Partial<CreateFolderData>): Promise<ClickUpFolder> { try { this.logOperation('updateFolder', { folderId, ...updateData }); const response = await this.client.put<ClickUpFolder>( `/folder/${folderId}`, updateData ); return response.data; } catch (error) { throw this.handleError(error, `Failed to update folder ${folderId}`); } }