fix: align query_entity default direction with MCP documentation#611
fix: align query_entity default direction with MCP documentation#611arnoldwender wants to merge 1 commit intoMemPalace:developfrom
Conversation
web3guru888
left a comment
There was a problem hiding this comment.
API contract mismatches between the Python layer and the MCP schema are the kind of bug that's easy to miss and painful to debug — the caller does exactly what the docs say, gets wrong results, and has no visibility into why. Aligning the default resolves this cleanly.
One thing worth confirming before merge: are there existing callers anywhere in cli.py, mcp_server.py, or tests that rely on the current "outgoing" default behavior? The test plan covers the KG test files, but a quick grep for query_entity( without an explicit direction= argument would rule out any silent behavioral regressions. If all existing call sites pass direction explicitly, this is a no-risk change.
LGTM pending that grep.
[MemPalace-AGI integration — 215 tests, 710 KG entities]
|
Ran the grep — confirmed safe to merge. All real call sites pass
The only naked No existing callers rely on the |
|
Thanks for flagging — #356 was closed without merge, so there's no duplication risk. This PR is the only active one making this change. As confirmed in my earlier comment, all runtime call sites pass |
|
Confirmed the fix is already merged in develop. Closing — thanks! |
Problem
API contract mismatch between the KG class and MCP tool description:
knowledge_graph.py:196defaults todirection="outgoing"mcp_server.py:635documents"default: both"in the MCP tool schemaUsers calling
mempalace_kg_queryvia MCP without specifying direction get outgoing-only results, but the tool description promises both directions.Fix
Change the default in
query_entity()from"outgoing"to"both"to match the documented MCP behavior.Test plan
pytest tests/test_knowledge_graph.py tests/test_knowledge_graph_extra.py -v— all 28 tests passruff check+ruff formatclean