Files
mempalace/tests
Igor Lins e Silva ad9874fcd5 fix(mcp): repair diary_write content alias + restore -32602 diagnostic
#1245 landed on develop with three defects that turned the branch red:

- tool_diary_write gave `entry` a default (`entry: str = None`), which
  silently disabled the signature-based missing-parameter diagnostic
  (-32602) — two TestParamShapeDiagnostics tests failed.
- the `content` alias was never added to the tool input schema, so the
  dispatch arg-filter stripped `content` before the handler ever saw it,
  so the alias never actually worked.
- the filtered-search fallback inlined into search_memories pushed it
  over the C901 complexity ceiling (30 > 25), and mcp_server.py was left
  unformatted.

Fix:
- restore `entry` as a required param (revives the -32602 diagnostic)
- add `content` to the diary_write schema and remap content->entry at
  dispatch, before the handler, so a content-only call still satisfies
  the required `entry` (entry wins if both are supplied)
- extract the fallback into _query_drawers_with_filter_fallback() so
  search_memories drops back under the complexity ceiling
- ruff format mcp_server.py
- add regression tests for the content alias (content-only + both-supplied)

Keeps #1245's filtered-search recall fix intact; turns develop green.
2026-06-06 00:42:26 -03:00
..