Fix: Enable custom group_id in add_episode MCP tool
Problem:
The add_episode MCP tool failed when a custom group_id string was provided, erroring with Parameter 'group_id' must be of type undefined, got string. This prevented assigning episodes to specific, non-default groups.
Solution:
This branch corrects the handling of the group_id parameter in the add_episode tool, allowing custom string group_ids to be processed successfully.
Verification:
On this branch, after restarting the server:
-
Adding Episodes: Successfully added episodes with distinct custom
group_ids (e.g.,project_alpha_fix_test_001,project_beta_fix_test_002). -
Searching Nodes:
- Confirmed
search_nodescorrectly filters by a single specifiedgroup_id. - Confirmed
search_nodescorrectly filters by a list of specifiedgroup_ids.
- Confirmed
This validates that adding to and searching within custom groups now works as intended.
Note on Search Behavior:
Currently, search_nodes without a specified group_id defaults to the server's main group_id rather than searching all groups. This could be a future enhancement if "search all" is desired for that scenario.
[!IMPORTANT] Fixes
add_episodetool to correctly handle customgroup_idstrings and updates related functions for default handling.
- Behavior:
- Fixes handling of
group_idinadd_episodeto accept custom strings, defaulting toconfig.group_idif empty.- Updates
search_nodes,search_facts, andget_episodesto handle emptygroup_idas default.- Configuration:
GraphitiConfig.from_cli_and_env()now setsgroup_idwith precedence: CLI > Env Var > Default.- Logs
group_idsource ininitialize_server().- Testing:
Makefile: Updatestesttarget to load.env.testusingpython-dotenv.pyproject.toml: Addspython-dotenv-runto dev dependencies.This description was created by
for 7aba34bca9e6f3428d4c7a0bf8e55713d5972ec3. You can customize this summary. It will automatically update as commits are pushed.
All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.
I have read the CLA Document and I hereby sign the CLA
@markalosey Thank you for this contribution! Just a heads up: I won't be able to review the PR for a few weeks. Expect an early June response. Apologies in advance for the delay!
Thanks for the contribution, are you able to resolve the conflicts?
I apologize for the delay. I'm just seeing this. I'll get to it this weekend