Skip to main content
Glama

agent_remember

Record stable agent context by persisting non-secret key-value notes in encrypted memory across sessions. Use for last rotation dates, user preferences, or prior decisions. Idempotent: overwrites same key.

Instructions

[agent] Persist a non-secret key/value note in encrypted, on-disk agent memory that survives across MCP sessions. Use to record stable agent context — last rotation date for a key, the user's deployment preferences, decisions taken in earlier sessions; do NOT use this to store secrets (use set_secret instead) and prefer chat scratchpad for purely transient state. Mutates the encrypted memory store. Idempotent: rewriting the same key with a new value simply overwrites. Returns 'Remembered "KEY"' on success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesMemory key (free-form string). Convention: lowercase dotted namespaces, e.g. 'project.lastDeploy'.
valueYesPlain-string value to store. JSON-stringify structured data on the caller side if needed.

Implementation Reference

  • The 'registerAgentTools' function registers the 'agent_remember' tool with the MCP server. The handler function (lines 26-32) calls 'enforceToolPolicy', then invokes the core 'remember()' function with the key/value params, returning a success message.
    export function registerAgentTools(server: McpServer): void {
      server.tool(
        "agent_remember",
        [
          "[agent] Persist a non-secret key/value note in encrypted, on-disk agent memory that survives across MCP sessions.",
          "Use to record stable agent context — last rotation date for a key, the user's deployment preferences, decisions taken in earlier sessions; do NOT use this to store secrets (use `set_secret` instead) and prefer chat scratchpad for purely transient state.",
          "Mutates the encrypted memory store. Idempotent: rewriting the same key with a new value simply overwrites. Returns 'Remembered \"KEY\"' on success.",
        ].join(" "),
        {
          key: z
            .string()
            .describe(
              "Memory key (free-form string). Convention: lowercase dotted namespaces, e.g. 'project.lastDeploy'.",
            ),
          value: z
            .string()
            .describe(
              "Plain-string value to store. JSON-stringify structured data on the caller side if needed.",
            ),
        },
        async (params) => {
          const toolBlock = enforceToolPolicy("agent_remember");
          if (toolBlock) return toolBlock;
    
          remember(params.key, params.value);
          return text(`Remembered "${params.key}"`);
        },
      );
  • Zod schema for 'agent_remember' inputs: 'key' (string, lowercase dotted namespace convention) and 'value' (plain string, JSON-stringify structured data on caller side).
    {
      key: z
        .string()
        .describe(
          "Memory key (free-form string). Convention: lowercase dotted namespaces, e.g. 'project.lastDeploy'.",
        ),
      value: z
        .string()
        .describe(
          "Plain-string value to store. JSON-stringify structured data on the caller side if needed.",
        ),
    },
  • Import of 'registerAgentTools' from the agent tools module.
    import { registerAgentTools } from "./tools/agent.js";
  • Registration call: 'registerAgentTools(server)' invoked during MCP tool setup.
    registerAgentTools(server);
  • Core 'remember' function: loads the encrypted memory store, writes the key/value pair with a timestamp, and saves the store back to disk.
    export function remember(key: string, value: string): void {
      const store = loadStore();
      store.entries[key] = {
        value,
        updatedAt: new Date().toISOString(),
      };
      saveStore(store);
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Despite no annotations, the description details encryption, on-disk persistence, survival across sessions, mutation, and idempotency. Minor omission: no mention of size limits or performance.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, no fluff, purpose first, then usage guidance, then return value. Highly efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, usage, behavior, parameters, and return value. No output schema, but return string is specified. Complete for a simple persistence tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers both parameters fully; description adds useful conventions (lowercase dotted namespaces, JSON-stringify structured data) beyond schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool persists non-secret key/value notes in encrypted memory, distinguishing it from siblings like set_secret and chat scratchpad. It specifies stable agent context and excludes secrets.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use (recording stable context) and when-not-to-use (secrets, transient state) with alternative tool names (set_secret, chat scratchpad). Also notes idempotency.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/I4cTime/quantum_ring'

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