Skip to main content
Glama

memory_add

Saves facts, preferences, decisions, and notes to persistent local memory for recall across sessions; call proactively when users share conventions or choices worth remembering.

Instructions

Save a fact, preference, decision, or note to persistent local memory. Call this PROACTIVELY whenever the user shares something worth remembering across sessions — project conventions, tool choices, personal preferences, decisions made, error fixes and their causes. Worth saving: decisions and their reasons, preferences, conventions, gotchas, approaches tried and abandoned. Not worth saving: one-off task details or anything re-derivable from the code. Do not wait to be asked. For facts you infer yourself rather than the user stating, propose them first and save only on approval. Keep each memory to one self-contained statement; attach aliases when the parameter is available. If a note tells you the user's own wording was already stored verbatim this turn, that statement is already saved: do not retry it in a rewording — save only what that text does not contain, or use memory_supersede on the given id. Default scope is the current project; use the personal scope for facts about the user that apply across all projects. Returns the new memory's id; an identical fact already stored returns that id instead of duplicating.

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": {
      "content": "<content>"
    },
    "name": "memory_add"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoOptional tags for filtering.
typeNoCategory of memory. Default: fact.
aliasNoD81: nickname this memory defines (e.g. 香蕉计划). Pairs with `target`: the alias memory expands queries in its scope at search time, both directions, no reindex. Explicit vocabulary — always stored, not gated by capture aliases.
scopeNoMemory scope. `project` = tied to this repo. `personal` = global across all your projects. Default: project.
sourceNoWhere this memory came from. Default: tool. Pass 'inference' for agent-proposed captures (V2-DESIGN §3.5).
targetNoD81: what `alias` refers to (e.g. 支付系统重构项目). Only meaningful with `alias`.
aliasesNoOptional: alternate phrasings of this fact — synonyms, another way a question might be worded, equivalents in the user's other language (e.g. 节假日 for 'public holidays'). They are indexed with the memory so differently-worded questions still match. Always on. Send at most 4; extras and blanks are dropped silently, never an error.
contentYesThe fact to remember. One idea per memory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.8.2
    • addedInput schema / properties / alias
      Added value: +{
      +  "description": "D81: nickname this memory defines (e.g. 香蕉计划). Pairs with `target`: the alias memory expands queries in its scope at search time, both directions, no reindex. Explicit vocabulary — always stored, not gated by capture aliases.",
      +  "type": "string"
      +}
    • changedInput schema / properties / aliases / description
      Previous value: -"Optional: alternate phrasings of this fact — synonyms, another way a question might be worded, equivalents in the user's other language (e.g. 节假日 for 'public holidays'). They are indexed with the memory so differently-worded questions still match. Only used when the install has capture aliases enabled (init default). Send at most 4; extras and blanks are dropped silently, never an error."New value: +"Optional: alternate phrasings of this fact — synonyms, another way a question might be worded, equivalents in the user's other language (e.g. 节假日 for 'public holidays'). They are indexed with the memory so differently-worded questions still match. Always on. Send at most 4; extras and blanks are dropped silently, never an error."
    • addedInput schema / properties / target
      Added value: +{
      +  "description": "D81: what `alias` refers to (e.g. 支付系统重构项目). Only meaningful with `alias`.",
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv0.7.3
    • changedInput schema / properties / scope / description
      Previous value: -"Memory scope. `project` = tied to this repo. `personal` = global across all your projects. `user` is a deprecated alias of `personal`. Default: project."New value: +"Memory scope. `project` = tied to this repo. `personal` = global across all your projects. Default: project."
    • changedInput schema / properties / scope / enum
      Previous value: -[
      -  "project",
      -  "personal",
      -  "user"
      -]New value: +[
      +  "project",
      +  "personal"
      +]
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare the safety profile (non-read-only, non-destructive, closed-world); the description adds substantially beyond that: it returns the new memory's id, identical facts dedupe to an existing id instead of duplicating, and self-inferred facts require proposal before saving. That is strong mutation-behavior disclosure, though nothing is said about failure modes or limits on memory size.

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?

Purpose is front-loaded in sentence one and the worth/not-worth lists are efficient. The dedup sentence ('If a note tells you the user's own wording was already stored verbatim...') is a long, hard-to-parse conditional that costs more reading effort than the edge case warrants.

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?

For an 8-parameter write tool with no output schema, the description covers the missing pieces itself: the return value (new memory id), dedupe semantics, scope defaults, and the approval workflow for inferred captures. An agent has everything needed to invoke it correctly.

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 100%, so the baseline is 3, but the description adds selection guidance the schema only partially carries: default scope is the current project and personal scope is for user-level cross-project facts, plus 'attach aliases when the parameter is available' and 'keep each memory to one self-contained statement'. That meaningfully shapes how type/scope/alias/content get filled in.

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 first sentence uses a specific verb + resource ('Save a fact... to persistent local memory') and enumerates the content types it accepts. It differentiates itself from the sibling set by naming memory_supersede as the alternative for a rewording case, so an agent can route correctly without opening schemas.

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?

Explicit when-to-call ('Call this PROACTIVELY whenever the user shares something worth remembering'), a positive list of what's worth saving, a negative list ('one-off task details or anything re-derivable from the code'), and a named alternative (memory_supersede). It also specifies an approval gate for inferred facts, which is real routing behavior, not filler.

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