-
Notifications
You must be signed in to change notification settings - Fork 66
Description
Description
Using the expand parameter on list_work_items (e.g., expand=state,labels) causes Pydantic validation errors because the WorkItem model expects state as str | None, but the Plane API returns an expanded StateLite dict when expand is used.
Steps to Reproduce
- Call
list_work_itemswithexpand="state"orexpand="state,labels" - Observe Pydantic validation errors:
23 validation errors for PaginatedWorkItemResponse
results.0.state
Input should be a valid string [type=string_type, input_value={'id': '6a66a67d-...', 'name': 'Ideas', ...}, input_type=dict]
Root Cause
In plane/models/work_items.py, the WorkItem class defines:
state: str | None = None # line ~45When expand=state is used, the API returns a StateLite dict instead of a UUID string, which fails validation.
The WorkItemDetail and WorkItemExpand classes in the same file already handle this correctly:
# WorkItemDetail (correct)
state: str | StateLite | None = None
# WorkItemExpand (correct)
state: StateLite | None = NoneSuggested Fix
Update WorkItem.state to accept both types:
state: str | StateLite | None = NoneThe same issue likely applies to labels and assignees fields on WorkItem, which would also return expanded objects when expand is used.
Workaround
Avoid using the expand parameter with list_work_items. Instead, fetch work items without expand and cross-reference state/label UUIDs against list_states / list_labels results separately.
Environment
plane-mcp-serverversion: 0.2.3- Python: 3.12
- Installed via
uvx