Skip to content

fix(mcp): validate episode types before queueing - #1638

Open
vismaytiwari wants to merge 2 commits into
getzep:mainfrom
vismaytiwari:fix-mcp-attributes-content
Open

fix(mcp): validate episode types before queueing#1638
vismaytiwari wants to merge 2 commits into
getzep:mainfrom
vismaytiwari:fix-mcp-attributes-content

Conversation

@vismaytiwari

Copy link
Copy Markdown

Addresses #1164

Summary

This validates MCP episode type configuration before an episode is added to the background queue.

Previously, add_memory could return a queued-success response even when Graphiti.add_episode would immediately reject the configured entity types. The queue worker then logged the failure later, so callers only saw success while the episode was never processed.

This reuses Graphiti's existing entity-type and excluded-entity-type validators in QueueService.add_episode, before creating the background task. Invalid reserved fields such as DataObject.attributes now fail before queueing, so the MCP tool returns an error instead of a false success message.

Validation

  • Reproduced the current behavior locally: QueueService.add_episode returned a queue position, then the worker logged attributes cannot be used as an attribute for DataObject as it is a protected attribute name.
  • Verified after the change that the same case raises before queue creation and the Graphiti client is not called.
  • Verified add_memory now returns an error response for that case and does not create a queue.
  • uv run pytest tests/test_core_parity.py -q from mcp_server: 28 passed.
  • uv run ruff check src/services/queue_service.py tests/test_core_parity.py: passed.
  • uv run ruff format --check src/services/queue_service.py tests/test_core_parity.py: passed.
  • uv run pyright src/services/queue_service.py: 0 errors.

Note: I also tried MCP-wide uv run pyright src tests, but it currently reports existing unrelated MCP test/import typing issues, so I kept the pyright check scoped to the changed service file.

@zep-cla-assistant

zep-cla-assistant Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@vismaytiwari

vismaytiwari commented Jul 8, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA behalf of myself , e-mail: vismay.t@gmail.com

@vismaytiwari

Copy link
Copy Markdown
Author

recheck

zep-cla-assistant Bot added a commit that referenced this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant