Skip to main content
Glama

add_long_term_memory

Store persistent memories with custom JavaScript triggers that activate based on conversation context, keywords, or specific conditions to provide relevant information when needed.

Instructions

Add a new long-term memory with a trigger condition. The trigger is JavaScript code that determines when this memory should be activated. Available context: context.messages (array), context.conversation_id (string), context.participants (object). Available functions: match_keys(messages, keywords, scope, depth), match_keys_all(messages, keywords, scope, depth).

Input Schema

NameRequiredDescriptionDefault
nameYes
promptYes
triggerYes
createdContextNo
recentMessagesNo

Input Schema (JSON Schema)

{ "properties": { "createdContext": { "_def": { "description": "Optional context about when/why this memory was created", "innerType": { "_def": { "checks": [], "coerce": false, "typeName": "ZodString" }, "~standard": { "vendor": "zod", "version": 1 } }, "typeName": "ZodOptional" }, "~standard": { "vendor": "zod", "version": 1 } }, "name": { "_def": { "checks": [], "coerce": false, "description": "Unique name for the memory", "typeName": "ZodString" }, "~standard": { "vendor": "zod", "version": 1 } }, "prompt": { "_def": { "checks": [], "coerce": false, "description": "The memory content to be recalled when triggered", "typeName": "ZodString" }, "~standard": { "vendor": "zod", "version": 1 } }, "recentMessages": { "_def": { "description": "Optional recent messages to auto-generate createdContext", "innerType": { "_def": { "exactLength": null, "maxLength": null, "minLength": null, "type": { "_cached": null, "_def": { "catchall": { "_def": { "typeName": "ZodNever" }, "~standard": { "vendor": "zod", "version": 1 } }, "typeName": "ZodObject", "unknownKeys": "strip" }, "~standard": { "vendor": "zod", "version": 1 } }, "typeName": "ZodArray" }, "~standard": { "vendor": "zod", "version": 1 } }, "typeName": "ZodOptional" }, "~standard": { "vendor": "zod", "version": 1 } }, "trigger": { "_def": { "checks": [], "coerce": false, "description": "JavaScript code that returns true/false to determine if memory should activate. Example: \"match_keys(context.messages, ['birthday'], 'any') || new Date().getMonth() === 6\"", "typeName": "ZodString" }, "~standard": { "vendor": "zod", "version": 1 } } }, "required": [ "name", "prompt", "trigger" ], "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/win10ogod/memory-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server