Skip to content

Memory MCP, schema validation error: MCP error -32602 #3074

@VicioBonura

Description

@VicioBonura

Bug Report: Memory MCP Server - Schema Validation Error

Summary

All read operations (read_graph, search_nodes, open_nodes) fail with schema validation error when reading entities from JSONL format memory file. The server includes the type field in entity objects when reading from file, but the output schema does not allow this field.

Environment

  • Server: @modelcontextprotocol/server-memory
  • Version: 2025.11.25 (latest available)
  • OS: Linux Ubuntu 24.04
  • MCP Client: Cursor IDE

Steps to Reproduce

  1. Configure Memory MCP server with a JSONL format memory.json file
  2. File contains entities with structure: {"type":"entity","name":"...","entityType":"...","observations":[...]}
  3. Call any read operation:
    • mcp_memory_read_graph
    • mcp_memory_search_nodes
    • mcp_memory_open_nodes
  4. All operations fail with the same error

Expected Behavior

Read operations should return entities without the type field, as entities are already separated in the response structure (data.entities vs data.relations).

Actual Behavior

All read operations return error:

{
  "error": "MCP error -32602: Structured content does not match the tool's output schema: data.entities[0] should NOT have additional properties"
}

No partial data is returned - the response contains only the error field.

Technical Details

  • File format: JSONL (newline-delimited JSON)
  • Total lines: 538
  • Entities: 206
  • Relations: 332
  • Entity schema in file: {type, name, entityType, observations} (4 fields)
  • Expected entity schema in output: {name, entityType, observations} (3 fields, no type)

The type field is necessary in the file to distinguish entities from relations, but should be stripped when preparing the response.

Workaround

  • Read data directly from memory.json file using file I/O
  • Write operations (create_entities, add_observations, etc.) work correctly
  • Only read operations are affected

Additional Information

  • The file structure is valid and can be read successfully using direct file access
  • The issue appears to be in the server's schema validation logic
  • Cache cleared (npm cache clean --force) but issue persists
  • Issue occurs with latest server version (2025.11.25)

Error Code

MCP error -32602 - Invalid params / Schema validation error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions