feat(mcp): support optional metadata in add_memory and save-memory tools (#1817)

This commit is contained in:
Siddhesh Gawade 2026-10-14 13:58:26 -07:00 • committed by Mahesh Sanikommu
parent 8200e7f27d
commit cec177a7a3

View file

@ -13,6 +13,10 @@ export function register(deps: ToolDeps) {
description: "Save content to memory",
inputSchema: z.object({
content: z.string().min(1),
metadata: z
.record(z.string(), z.unknown())
.optional()
.describe("Optional key-value metadata to attach to the memory"),
namespace: namespaceSchema.optional(),
...legacyNamespaceInput,
viewId: z.string().uuid().optional(),
@ -28,7 +32,7 @@ export function register(deps: ToolDeps) {
return deps.errorResult(new Error("namespace is required"))
const viewId = args.viewId ?? crypto.randomUUID()
const client = deps.getClient(namespace)
const result = await client.createMemory(args.content)
const result = await client.createMemory(args.content, args.metadata)
const sc: ViewMessage = withLegacyView({
view: "save-success",
viewId,