Skip to content

[BUG] build_context fails schema validation in MCP client (missing fields / date-time format) #263

Description

@se1961

Bug Description

Calling basic-memory.build_context with a valid memory://… URI fails schema validation in an MCP client. Other endpoints (search_notes, read_note) work as expected.

Steps To Reproduce

  1. Resolve a note:

    • Title: Techniques Elsa Can't Use
    • URI returned by search_notes: memory://conversations/20250429-Techniques_Elsa_Cant_Use
  2. Call:

    {"url":"memory://conversations/20250429-Techniques_Elsa_Cant_Use"}

via basic-memory.build_context

Expected Behavior

Response conforms to the tool’s declared output schema; client can render context.

Actual Behavior

Client error:

MCP error -32602: Structured content does not match the tool's output schema:
data.results[0].primary_result.created_at should match format "date-time",
data.results[0].primary_result should have required property 'relation_type',
data.results[0].primary_result should have required property 'category',
data.results[0].primary_result should match some schema in anyOf

Environment

  • Basic Memory: v0.14.3 (installed via uv)
  • Server command: uv tool run basic-memory mcp
  • OS/CPU: macOS (Apple Silicon)
  • MCP client: ChatWise (stdio; tools auto-run)
  • Project path: /Users/shelley/basic-memory
  • Fresh DB after basic-memory reset; ~84 notes indexed

Additional Context

  • Reproduces consistently after reset and full app restart.

  • search_notes and read_note succeed for the same memory:// target.

  • Same behavior across different models (provider kept constant per thread).

Client config (for completeness)

{
"mcpServers": {
"basic-memory": {
"command": "uv",
"args": ["tool", "run", "basic-memory", "mcp"],
"transport": "stdio"
}
}
}

Workaround

Temporarily avoid build_context and emulate context with search_notes → read_note → related notes (1–2).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions