fix: coerce string params to list/dict in MCP tools#657
Conversation
Some MCP clients (Claude Desktop, others) serialize list/dict arguments as JSON strings instead of native types. Pydantic's validate_call rejects these with validation errors. Add BeforeValidator coercion via coerce_list/coerce_dict helpers to affected parameters in search_notes, write_note, and canvas tools. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
|
Claude finished @phernandez's task in 1m 32s —— View job PR Review:
|
Addresses review feedback — canvas nodes/edges coercion was untested through the FastMCP client path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
|
Claude finished @phernandez's task in 55s —— View job PR Review:
|
Summary
Fixes #656 — MCP list/dict parameters fail with Pydantic validation when clients send strings.
coerce_listandcoerce_dicthelpers toutils.pyBeforeValidatorcoercion to affected parameters insearch_notes,write_note, andcanvastoolsentity_types,note_types,tags,metadata_filters(search),metadata(write_note),nodes/edges(canvas)Test plan
coerce_list/coerce_dict(tests/test_coerce.py— 13 tests)test-int/mcp/test_string_params_integration.py— 5 tests)🤖 Generated with Claude Code