Skip to main content
Glama

memory_add

Persist facts, preferences, decisions, and notes to local memory so AI coding agents recall context across sessions and projects.

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.

Input Schema

NameRequiredDescriptionDefault
tagsNoOptional tags for filtering.
typeNoCategory of memory. Default: fact.
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).
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. Only used when the install has capture aliases enabled (init default). 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. 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"
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnly=false, destructive=false, openWorld=false. The description goes well beyond that: idempotent dedup behavior (an identical fact returns the existing id), the return value, default scope semantics, alias indexing behavior (max 4, silently dropped extras), and a no-retry rule for verbatim-stored content. Rich behavioral context the annotations cannot carry.

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 and most sentences earn their place, but the definition is dense and the clause about content 'already stored verbatim this turn' is convoluted enough to slow an agent down. Slightly long, though not padded.

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?

Despite having no output schema, the description states what is returned (the new memory's id, or the existing id on a duplicate), covers scope selection, the propose-on-approval rule for inferences, and alias handling. Nothing an agent needs to call this correctly is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so all six parameters are already documented, including the scope and aliases semantics. The description reinforces the scope default and alias attachment but adds little syntax or format detail beyond the schema, so the baseline 3 is appropriate.

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 states a specific verb and resource ('Save a fact, preference, decision, or note to persistent local memory') and even enumerates the kinds of content it stores. It also differentiates from a sibling by naming memory_supersede for the verbatim-duplicate case.

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?

Explicitly says when to use it ('PROACTIVELY whenever the user shares something worth remembering'), when not to ('one-off task details or anything re-derivable from the code'), the propose-first condition for inferred facts, and routes the duplicate case to memory_supersede. This is about as complete as usage guidance gets.

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