Skip to content

fix(mcp): restore write_note overwrite schema for external clients (#818)#841

Open
rudi193-cmd wants to merge 1 commit into
basicmachines-co:mainfrom
rudi193-cmd:fix/write-note-overwrite-schema
Open

fix(mcp): restore write_note overwrite schema for external clients (#818)#841
rudi193-cmd wants to merge 1 commit into
basicmachines-co:mainfrom
rudi193-cmd:fix/write-note-overwrite-schema

Conversation

@rudi193-cmd
Copy link
Copy Markdown

Summary

  • Reverts overwrite on write_note from Annotated[..., Field(validation_alias=AliasChoices(...))] to plain bool | None = None.
  • Root cause: AliasChoices on optional bool | None made FastMCP emit a JSON schema where external MCP clients (e.g. Claude Code) saw overwrite as null-only; overwrite=true was silently dropped. FastMCP's Python Client still passed tests because it validates via Pydantic directly.
  • Adds regression tests: MCP protocol overwrite guard + schema must expose boolean for overwrite.

directory aliases (folder/dir/path) are unchanged.

Test plan

  • pytest test-int/mcp/test_param_aliases_integration.py::test_write_note_overwrite_canonical_via_mcp
  • pytest test-int/mcp/test_param_aliases_integration.py::test_aliases_not_advertised_in_schema

Fixes #818

Made with Cursor

…asicmachines-co#818)

AliasChoices on optional bool | None made FastMCP emit a null-only JSON schema,
so Claude Code and other external MCP clients dropped overwrite=true. Revert to
a plain parameter; directory aliases unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: rudi193-cmd <rudi193@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] write_note returns "Note already exists" when called with explicit overwrite=true (regression from #766)

1 participant