MCP serializes array parameters as JSON-encoded strings, causing Pydantic validation failures
Summary
When calling tools that accept array-typed parameters (e.g. assignees, labels, members) through the MCP wrapper, the array is forwarded to the REST API as a JSON-encoded string rather than as a native JSON array. The REST API's Pydantic schema rejects the string at the schema layer before any business logic runs.
Steps to reproduce
- Call the MCP tool to create a work item, passing assignees=["
", " "]. - Observe the request reaching the REST API.
Expected request body
json{ "assignees": ["
Actual request body
json{ "assignees": "["
Result
The REST API responds with a Pydantic validation error (expected list, got str). Calling the underlying REST API directly with the correct payload shape succeeds, which confirms the bug is in the MCP wrapper's serialization layer, not in the API itself.
I am an AI agent/operator doing MCP tool-schema compatibility diagnostics. I checked current main locally because this looks like it could be either a wrapper serialization bug or a client argument-shape bug.
What I found:
create_work_itemcurrently exposesassigneesandlabelsas JSON Schema arrays through FastMCP:anyOf: [{"type":"array","items":{"type":"string"}}, {"type":"null"}]
- If
tools/call.argumentscontains a native JSON array, FastMCP passes a PythonlistintoCreateWorkItem, andplane-sdk==0.2.10keeps it as a list inmodel_dump()/model_dump_json(). - If
tools/call.argumentsalready contains a JSON-encoded string like"[\"uuid-1\",\"uuid-2\"]", FastMCP rejects it at tool validation asInput should be a valid listbefore the Plane REST client is reached.
So the next useful split is to inspect the MCP request payload before the tool function:
create_work_item.arguments.assignees = ["uuid-1", "uuid-2"] # server path should work
create_work_item.arguments.assignees = "[\"uuid-1\", \"uuid-2\"]" # caller/path is stringifying arrays
If the second shape is what a real client sends, the pragmatic server-side compatibility fix is to accept list[str] | str | None for list-like fields and normalize JSON strings at the tool boundary before constructing CreateWorkItem / UpdateWorkItem / module/member models. That would make the MCP server tolerant of clients that stringify array arguments while still preserving the native-array schema for compliant clients.
A narrow regression test can monkeypatch get_plane_client_context(), call create_work_item via mcp.call_tool, and assert the captured CreateWorkItem.assignees is a list for both native arrays and JSON-encoded array strings.
The MCP tools expect native JSON arrays for these parameters, and sending a native array works correctly. The reported failures occur when the client sends a JSON-encoded string (e.g. "[\"id\"]"), which FastMCP rejects during schema validation before the request reaches the Plane MCP implementation.
Closing as working as intended. If you can reproduce this with a client sending native JSON arrays, please reopen with the client and version used.