Fix create_list_from_template URL path#5
Conversation
The two methods `createListFromTemplateInFolder` and
`createListFromTemplateInSpace` in `src/clickup-client/lists.ts` were
calling `/folder/{id}/list/template/{templateId}` and
`/space/{id}/list/template/{templateId}`, which return HTTP 404.
The ClickUp REST API actually expects `/list_template/{templateId}`
(underscore) per the official endpoints:
- https://developer.clickup.com/reference/createlistfromtemplate
- https://developer.clickup.com/reference/createlistfromtemplateinspace
Replacing `list/template` with `list_template` makes the two MCP tools
work as documented. Verified locally against a real workspace by
building and invoking the server in stdio mode — the list is now
created with the template's statuses, custom fields, milestones and
sub-tasks intact.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdates the ClickUp list-template creation methods: fixes endpoint paths from Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant ListsClient as "lists.ts"
participant ClickUpAPI as "ClickUp API"
participant GetList as "getList()"
Caller->>ListsClient: create_list_from_template_in_folder/space(params)
ListsClient->>ClickUpAPI: POST /{folder|space}/list_template/{templateId} (params)
ClickUpAPI-->>ListsClient: 200 OK { id: createdListId, ... }
alt createdListId present
ListsClient->>GetList: getList(createdListId)
GetList->>ClickUpAPI: GET /list/{createdListId}
ClickUpAPI-->>GetList: 200 OK { full list object }
GetList-->>ListsClient: full list object
ListsClient-->>Caller: full list object
else no id or refetch fails
ListsClient-->>Caller: original POST response
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
ClickUp's POST /folder/{id}/list_template/{tid} (and the space variant)
returns the freshly created list with deleted:true — an artefact of how
the API serializes the just-spawned record. A refetch via getList shows
deleted:false. Rather than expose this footgun to callers, the client
now refetches the list immediately after creation and falls back to the
raw response only if the refetch fails.
|
Adding a small follow-up commit ( |
Summary
Fixes #4.
createListFromTemplateInFolderandcreateListFromTemplateInSpacewere calling/folder/{id}/list/template/{templateId}and/space/{id}/list/template/{templateId}, both of which return HTTP 404. The ClickUp REST API expects/list_template/{templateId}(one segment, with an underscore) per the official createListFromTemplate and createListFromTemplateInSpace endpoints.Verification
Built locally and ran the server in stdio mode against a real workspace. After the fix,
create_list_from_template_in_folderreturns the created list (200 OK), with the template's statuses, custom fields, milestones and sub-tasks intact. Before the fix it returned 404 deterministically.Test plan
npm run build) without errorsSummary by CodeRabbit