mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-10 22:41:17 +00:00
fix(mcp): strip API extras from listMemories entries
The client parsed /v4/memories/list with z.looseObject, which keeps unknown keys. The API returns extra per-entry fields (spaceId, orgId, metadata, memoryRelations, temporalContext, forgetReason, …) that flow into structuredContent, which is validated against the strict tool outputSchema (additionalProperties: false) — producing "data/memoryEntries/N must NOT have additional properties". Switch memoryEntrySchema and memoryEntryHistorySchema to z.object, which strips unknown keys on parse while still tolerating new API fields. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
149589ae7e
commit
7430a3e9d0
1 changed files with 3 additions and 2 deletions
|
|
@ -34,7 +34,8 @@ export interface DocumentsListResponse {
|
|||
pagination: SdkDocumentListResponse["pagination"]
|
||||
}
|
||||
|
||||
const memoryEntryHistorySchema = z.looseObject({
|
||||
// z.object strips API extras that the strict MCP output schema would reject.
|
||||
const memoryEntryHistorySchema = z.object({
|
||||
id: z.string(),
|
||||
memory: z.string(),
|
||||
version: z.number(),
|
||||
|
|
@ -48,7 +49,7 @@ const memoryEntryHistorySchema = z.looseObject({
|
|||
|
||||
export type MemoryEntryHistory = z.infer<typeof memoryEntryHistorySchema>
|
||||
|
||||
const memoryEntrySchema = z.looseObject({
|
||||
const memoryEntrySchema = z.object({
|
||||
id: z.string(),
|
||||
memory: z.string(),
|
||||
version: z.number(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue