Skip to content

Conversation

@cardmagic
Copy link

Summary

When loading entities and relations from JSONL files, the parsed JSON objects included extra properties like type (used for discriminating entity vs relation) and any other custom fields that may have been manually added or present in legacy data. These extra properties leaked into the Entity/Relation objects, causing MCP schema validation errors (-32602 Invalid params) when outputSchema validation is enabled.

The fix: Explicitly extract only the schema-defined properties (name, entityType, observations for entities; from, to, relationType for relations) instead of casting the entire parsed JSON object.

Test plan

  • Added test case that writes JSONL with extra properties and verifies they are stripped when loading
  • All 40 existing tests continue to pass

Fixes #3144

When loading entities and relations from JSONL files, the parsed JSON
objects included extra properties like `type` (used for discriminating
entity vs relation) and any other custom fields. These extra properties
leaked into the Entity/Relation objects, causing MCP schema validation
errors (-32602 Invalid params) when outputSchema validation is enabled.

The fix explicitly extracts only the schema-defined properties (name,
entityType, observations for entities; from, to, relationType for
relations) instead of casting the entire parsed object.

Fixes modelcontextprotocol#3144
@cardmagic
Copy link
Author

Closing as duplicate - this is already addressed by #3161

@cardmagic cardmagic closed this Dec 31, 2025
@cardmagic cardmagic deleted the fix/memory-entity-extra-properties branch December 31, 2025 05:08
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.

Memory MCP Schema Validation Error on read_graph for entities with additional properties

1 participant