Summary
memory_store MCP tool silently accepts calls with:
- Missing
content field → returns 200 OK + "Stored memory : " (empty content persisted)
- Invalid
memory_type (e.g. "invalid_xyz") → returns 200 OK + persists with arbitrary type
This violates input validation contract and pollutes the memory pool with junk records.
Environment
- Server:
https://api.thememoria.ai (production)
- MCP endpoint:
POST /mcp (JSON-RPC 2.0)
- Date observed: 2026-06-01
- Tool version: 23 tools exposed via
tools/list
Steps to Reproduce
Case 1: Missing content
curl -X POST https://api.thememoria.ai/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"memory_store","arguments":{"memory_type":"working"}}}'
Expected: 422 / 400 with "content is required"
Actual: 200 OK + {"result":{"content":[{"text":"Stored memory 019e8285fcf07332af076c65cbdb7b91: ","type":"text"}]}} — empty record persisted
Case 2: Invalid memory_type
curl -X POST https://api.thememoria.ai/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"memory_store","arguments":{"content":"x","memory_type":"invalid_xyz"}}}'
Expected: 422 / 400 with "memory_type must be one of: working|semantic|episodic|profile|procedural"
Actual: 200 OK + record persisted with memory_type: "invalid_xyz"
Impact
- Data integrity: Empty / malformed records pollute the pool
- No recovery at API level: The MCP
memory_purge does work for these records, but they shouldn't exist in the first place
- Hard to detect downstream: Search returns these records; downstream agents may consume them
Workaround
Clients must add their own pre-flight validation:
const VALID_TYPES = ['working', 'semantic', 'episodic', 'profile', 'procedural'];
if (!content || content.trim() === '') throw new Error('content required');
if (!VALID_TYPES.includes(memory_type)) throw new Error(`memory_type must be one of ${VALID_TYPES.join('|')}`);
Proposed Fix
- Schema-level validation:
inputSchema.required should include content and memory_type; memory_type should be enum: ["working","semantic","episodic","profile","procedural"]
- Server-side validation: Return JSON-RPC error code
-32602 (Invalid params) with descriptive message when validation fails
- Optional: Bulk-cleanup endpoint to remove records with empty
content or invalid memory_type
Related
Summary
memory_storeMCP tool silently accepts calls with:contentfield → returns200 OK+ "Stored memory : " (empty content persisted)memory_type(e.g."invalid_xyz") → returns200 OK+ persists with arbitrary typeThis violates input validation contract and pollutes the memory pool with junk records.
Environment
https://api.thememoria.ai(production)POST /mcp(JSON-RPC 2.0)tools/listSteps to Reproduce
Case 1: Missing
contentExpected: 422 / 400 with
"content is required"Actual: 200 OK +
{"result":{"content":[{"text":"Stored memory 019e8285fcf07332af076c65cbdb7b91: ","type":"text"}]}}— empty record persistedCase 2: Invalid
memory_typeExpected: 422 / 400 with
"memory_type must be one of: working|semantic|episodic|profile|procedural"Actual: 200 OK + record persisted with
memory_type: "invalid_xyz"Impact
memory_purgedoes work for these records, but they shouldn't exist in the first placeWorkaround
Clients must add their own pre-flight validation:
Proposed Fix
inputSchema.requiredshould includecontentandmemory_type;memory_typeshould beenum: ["working","semantic","episodic","profile","procedural"]-32602(Invalid params) with descriptivemessagewhen validation failscontentor invalidmemory_typeRelated