-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Open
Description
Description
When using the @modelcontextprotocol/server-memory package with the MCP Python client library, the search_nodes tool fails validation when entities exist in the knowledge graph.
Steps to Reproduce
- Use
@modelcontextprotocol/server-memoryvia npx - Create an entity:
create_entitieswith{"entities": [{"name": "Test", "entityType": "Person", "observations": ["test obs"]}]} - Search for the entity:
search_nodeswith{"query": "Test"}
Expected Behavior
The search result should pass validation and return successfully.
Actual Behavior
The MCP Python client throws a validation error:
RuntimeError: Invalid structured content returned by tool search_nodes: Additional properties are not allowed ('type' was unexpected)
On instance['entities'][0]: {'type': 'entity', 'name': 'Test', 'entityType': 'Person', 'observations': ['test obs']}
Root Cause
The search_nodes tool's output schema declares additionalProperties: false for entity items, but the actual response includes a type: "entity" field that isn't in the schema definition.
Suggested Fix
Either:
- Add
typeto the output schema properties, or - Remove
additionalProperties: falsefrom the schema, or - Remove the
typefield from the response
Environment
@modelcontextprotocol/server-memoryvia npx (latest)- MCP Python client library
- Python 3.12
Metadata
Metadata
Assignees
Labels
No labels