You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
get_node and get_neighbors disagree on the same label — get_node returns an arbitrary iteration-order match #3160
The MCP get_node and get_neighbors tools resolve a label differently, so the same lookup can return inconsistent answers. get_node does a raw substring scan over G.nodes(data=True) and returns matches[0] — whichever node comes first in graph iteration order. get_neighbors uses the tiered _find_node ranking plus find_node_ambiguity, which was added specifically so equally-good matches aren't
silently broken by iteration order.
For a hub name that matches several nodes in different files, get_node returns an arbitrary one while get_neighbors correctly reports the lookup as ambiguous.
Steps to reproduce
Run the MCP server against a graph where one label matches multiple nodes in different files (e.g. extract — an extract() entrypoint plus several extract_* helper nodes).
get_node({"label": "extract"}) → returns one node, e.g. extract_bash() in graphify/extractors/bash.py.
get_neighbors({"label": "extract"}) on the same server → returns Ambiguous: 'extract' matches N nodes in different files … retry with the repo-relative path or the full node id.
Expected behavior
Both tools resolve the same label the same way — either both return the same node, or both report it as ambiguous. A hub-name lookup should not silently pick one symbol.
Actual behavior
get_node returns an arbitrary match determined by G.nodes() iteration order (so a graph rebuild that reorders nodes can change the answer), while get_neighbors reports ambiguity. A caller looking up a hub name via get_node gets the wrong symbol with no signal that a tie was broken.
Root cause
_tool_get_node (graphify/serve.py): matches = [(nid, d) for nid, d in G.nodes(data=True) if <substring>] then matches[0].
find_node_ambiguity exists precisely to stop [0]-of-a-tie from presenting one arbitrary file as "the answer"; get_node never went through it.
Fix
Route get_node through the same resolver as get_neighbors so both share one resolution contract (tiered match + cross-file ambiguity). get_node then returns the tiered winner, or the same "Ambiguous — retry with path or id" message when the
winning tier spans several files.
Activity
safishamsi commentedon Aug 29, 2026
Fixed in v0.9.52: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.52. Closing as resolved.