Files
basicmachines-co-basic-memory/tests/mcp
claude[bot] 951d5d1ac4 fix: allow null optional fields in edit_note MCP tool
MCP clients (e.g. openclaw-basic-memory) may send explicit null values
for unused optional fields such as find_text, section, and
expected_replacements. Previously, expected_replacements was typed as
`int = 1` (non-optional), so FastMCP's JSON Schema validation rejected
null payloads before the function body ran.

Fix: change expected_replacements to Optional[int] = None and resolve
the effective value (defaulting to 1) inside the function body.
find_text and section were already Optional[str] so they handle null
correctly once schema validation passes.

Adds a regression test covering the exact payload shape from issue #606.

Fixes #606

Co-authored-by: bm-clawd <bm-clawd@users.noreply.github.com>
Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
2026-02-25 15:28:09 +00:00
..