Skip to main content
Glama

save_memory

Store a fact, decision, or finding for later recall, and flag corrections that replace an existing memory or update an evolving topic so outdated versions stop appearing in search.

Instructions

Saves a memory now: when the user asks to remember something, or when closing a task with a finding worth keeping. Never save a credential — a token, a private key, a password. Save where it lives ("the deploy token is in ~/.config/deploy/env"); a save that looks like a secret is refused.

CORRECTIONS. An UPDATED VERSION of something already saved — a correction, a fact that changed, a revised decision — has to say so, or the old one keeps competing in searches. Two parameters for two cases: supersedes (id) corrects ONE SPECIFIC EXISTING MEMORY you found with search_memory, which stops appearing (it is not deleted); topic (key) is for a subject that will KEEP EVOLVING, and the new save replaces the active one under that key in this project. Use EXACTLY the key shown as [topic: key]; keys are lowercase with collapsed whitespace, and beyond that they are exact. A new key does NOT replace a memory saved without one — use supersedes for that. Both may be sent at once; if they point at different memories nothing is saved and the response says why. Pick a short, stable key naming the SUBJECT and not the content (frontend-stack, payment-provider), and do not reuse one across unrelated facts: the previous version would vanish from searches. The response names what it replaced, with its id.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "save_memory"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNo
textYes
topicNoTopic key, optional. Set it if the subject will keep evolving: it replaces the active memory under the same key in the same project. A short, stable phrase naming the subject, e.g. `branching-policy`.
anchorNoWhat the memory was checked against: `<path>` or `<path>:<symbol>`, relative to the project. Recorded with the hash so a later `check_anchor` can say whether the code still matches.
projectNo
verifiedNoOptional, false by default. Set it to true ONLY for something you checked against the world in this session: a command you ran and read the output of, a file you opened, a test that passed. Not for what you inferred, what you were told, or what seems right. A memory saved this way comes back marked `[verified]`, and the mark is worth exactly as much as your honesty about it: marking a guess makes the next session trust a guess. What you did not check is still worth saving — save it unmarked, and mark it later with `mem verify <id>` when something confirms it.
supersedesNoId of a specific, active memory that this one corrects and replaces, optional. It is the one that will stop appearing in searches. Use it to correct something already saved, with or without a topic key.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so: it discloses that secret-like saves are refused, that `supersedes` hides rather than deletes the old memory, that `topic` replaces the active memory under that key in the project, that a new key does not replace an untagged memory, and that conflicting `supersedes`+`topic` results in nothing being saved with an explanatory response. The warning about key reuse causing prior facts to vanish from searches is exactly the kind of consequence an agent needs before mutating state.

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

Conciseness4/5

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

The safety rule and the trigger conditions are front-loaded before the more intricate correction mechanics, which is the right ordering. The CORRECTIONS block is dense but every clause adds a decision rule; the heavy capitalization and em-dash asides are slightly noisy but not wasteful.

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

Completeness4/5

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

For a 7-parameter mutation tool with no annotations and no output schema, the description covers the dangerous paths (secrets, overwrite semantics, conflicting parameters) and tells the agent what the response reports ('names what it replaced, with its id'). It stops short of describing how tags or project scoping affect visibility, and the `verified` flag's downstream effect is only partially covered in the prose versus its schema text.

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 coverage is 57%, so the description must add meaning, and it does for the two hardest parameters: it explains the exact interaction and failure mode of `supersedes` vs `topic`, and prescribes key formatting (lowercase, collapsed whitespace, exact match, subject-not-content, short and stable). It says little about `tags`, `project`, or `anchor` beyond what the schema already documents, leaving some mid-coverage gaps.

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 opening clause names a specific verb and resource ('Saves a memory now') and immediately scopes it to two triggering situations. It is clearly distinguishable from siblings like search_memory and get_memory, which it references only as the lookup step for finding an id to supersede.

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?

It gives explicit when-to-use conditions (user asks to remember something; closing a task with a finding worth keeping), an explicit when-not ('Never save a credential'), and a routing rule between the two correction parameters: `supersedes` for one specific found memory, `topic` for an evolving subject. It even names the prerequisite tool (`search_memory`) for obtaining the id.

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