mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-11 03:37:56 +00:00
feat(mcp): support metadata in add_memory
This commit is contained in:
parent
39ca1ac190
commit
47d7818dd5
1 changed files with 2 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ export function register(deps: ToolDeps) {
|
|||
.describe("The memory content to save or forget"),
|
||||
action: z.enum(["save", "forget"]).optional().default("save"),
|
||||
containerTag: optionalContainerTagSchema,
|
||||
metadata: z.record(z.string(), z.unknown()).optional().describe("Optional metadata to attach to the saved memory"),
|
||||
})
|
||||
|
||||
deps.server.registerTool(
|
||||
|
|
@ -42,7 +43,7 @@ export function register(deps: ToolDeps) {
|
|||
}
|
||||
}
|
||||
|
||||
const result = await client.createMemory(args.content)
|
||||
const result = await client.createMemory(args.content, args.metadata)
|
||||
const message = `Memory saved (ID: ${result.id}, space: ${result.containerTag})`
|
||||
const structuredContent: AddMemoryOutput = {
|
||||
action: "save",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue