Fix name shadowing bug in find_name_variants tool - #5
Conversation
The find_name_variants MCP tool imported a utility function of the same name from gedcom_name_utils. Once @mcp.tool() decorated the async function, it rebound the module-level name find_name_variants to a FunctionTool object, shadowing the earlier import. The tool's internal call to find_name_variants(name_string) then resolved to that FunctionTool object instead of the utility function, causing: 'FunctionTool' object is not callable.
Fix: aliased the import as _find_name_variants and updated the call site to use the alias, avoiding the name collision.
Verified via direct repro script and live MCP tool calls (find_name_variants('Enoch') -> ['Enoch', 'E.'], find_name_variants('Thomas') -> ['Thomas', 'T.']).
There was a problem hiding this comment.
Code Review
This pull request resolves a name shadowing issue in src/gedcom_mcp/fastmcp_server.py by aliasing the imported find_name_variants function to _find_name_variants to avoid conflict with the MCP tool of the same name. The reviewer correctly points out that several other MCP tools in the same file (normalize_name, normalize_place_name, and extract_geographic_hierarchy) suffer from the exact same shadowing bug and suggests applying the same aliasing pattern to them.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…xtract_geographic_hierarchy tools Same root cause as the find_name_variants fix in this branch: each of these MCP tools imported a utility function of the same name, and @mcp.tool() decoration rebound the module-level name to a FunctionTool object, shadowing the import. The tool's internal call then failed with 'FunctionTool' object is not callable. Fix: aliased each import (_normalize_name, _normalize_place_name, _extract_geographic_hierarchy) and updated the corresponding call sites, matching the pattern already used for find_name_variants. Verified via repro script and live MCP tool calls for all three tools.
The find_name_variants MCP tool imported a utility function of the same name from gedcom_name_utils. Once @mcp.tool() decorated the async function, it rebound the module-level name find_name_variants to a FunctionTool object, shadowing the earlier import. The tool's internal call to find_name_variants(name_string) then resolved to that FunctionTool object instead of the utility function, causing: 'FunctionTool' object is not callable.
Fix: aliased the import as _find_name_variants and updated the call site to use the alias, avoiding the name collision.
Verified via direct repro script and live MCP tool calls (find_name_variants('Enoch') -> ['Enoch', 'E.'], find_name_variants('Thomas') -> ['Thomas', 'T.']).