Skip to main content
Glama

save_memory

Persist durable facts, rules, preferences, and lessons to version-controlled memory so assistants recall them across sessions. Update by slug or supersede stale entries.

Instructions

Persist a new fact, rule, preference, or lesson to the memory store for future sessions. CALL THIS: whenever you learn something the user would want you to remember next time — a preference they stated, a rule they corrected you on, a project decision, a lesson from a mistake, or a reference to an external system. Do NOT save ephemeral or task-specific details; save durable facts only. If a memory with the same slug already exists, this updates it — that is exactly how 'tr' trackers are meant to be updated when an entity's state changes. When this memory CORRECTS or replaces existing ones, pass their slugs in 'supersedes' instead of writing 'CORRECTED:' prefixes or leaving stale duplicates.

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": {
      "slug": "<slug>",
      "rule": "<rule>"
    },
    "name": "save_memory"
  }
}

Input Schema

NameRequiredDescriptionDefault
whyNoWhy this rule exists — the incident, reason, or motivation. Optional but strongly recommended.
bodyNoFull long-form detail behind the rule — state, decisions, code paths, context. Multi-line markdown welcome; this is stored losslessly and returned by get_memory. Use it instead of cramming detail into 'rule'.
ruleYesThe primary fact or rule to remember (max ~200 chars). Write as a declarative statement: 'always X', 'never Y', 'Z is located at ...'
slugYesShort kebab-case identifier, unique per memory. Examples: 'user-prefers-terse-responses', 'ig-pipeline-no-fallback', 'trading-confirm-only-orders'. Use existing slug to update.
tagsNoTopic tags for filtering. Examples: ['instagram', 'trading', 'admin']
typeNoAlias for type_code (read tools return this field as 'type', so both spellings work here).
whenNoWhen / where to apply this rule. Optional.
projectNoProject this memory belongs to. Defaults to the current workspace — set explicitly only for global facts (pass empty string "" = applies everywhere) or another project. If omitted AND the workspace can't be detected, the memory is quarantined under '_unknown' instead of becoming global.
relatedNoSlugs of related memories (cross-references, not replacement).
priorityNo1=low (background context), 2=medium (default — apply when relevant), 3=critical (always loaded, applied in every session)
triggersNoThe tool calls this rule governs, so it is enforced when the agent ACTS, not only when the user's words match it. Each item: command (regex on a Bash command) or path (glob on the file a Write/Edit touches), optionally tool (regex) and cwd (regex on where the action happens). A priority-3 fb/cn memory with a matching trigger REFUSES the call; others add the rule as context. Example: [{"command": "git (checkout|switch) -b |git worktree add", "cwd": "api"}, {"path": "api/scripts/*.sql"}]. Omit on an update to keep the existing triggers; [] clears them.
type_codeNofb=feedback (corrections, preferences, how the user likes to work), us=user (who the user is, their role, expertise, goals), pj=project (active projects, goals, decisions, deadlines), rf=reference (pointers to external systems, URLs, tools), cn=convention (code style, naming, architecture rules), lx=lesson (lessons learned, post-mortems, 'we got burned by X'), co=core (the per-project operating guide — which tools/skills/commands to reach for; always injected at session start, subordinate to the repo's own rules), tr=tracker (LIVE STATUS of exactly one entity — a deploy, draft, migration, campaign. One tracker per entity, slug '<entity>-status', tags naming the entity; UPDATE it by re-saving the same slug whenever the state changes. Trackers render as the status board at session start; memgit is the authority for this status, files are downstream)fb
supersedesNoSlugs of memories this one REPLACES (corrections, updated decisions, resolved incidents). Pass this instead of writing 'CORRECTED:' prefixes or leaving stale duplicates — superseded memories stop surfacing in search/recall/resume automatically (history is preserved; remove the superseder and they return).
unverifiedNoMark this memory as a CANDIDATE (unconfirmed) — use for facts seeded from repo files, imported, or synced from another writer that you have not confirmed. Unverified memories are kept OUT of high-authority injection (core guide, critical rules, status board) and flagged in recall until promoted with verify_memory. Content that looks instruction-shaped is auto-marked unverified regardless of this flag.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.14.3

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does substantial work: it discloses upsert semantics (same slug updates rather than duplicates), that superseded memories stop surfacing in search/recall/resume, and how trackers are meant to be re-saved on state change. It does not state what a successful call returns or whether the write is reversible at the API level, which is the remaining gap given there is no output schema.

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?

Front-loaded with purpose, then use conditions, then the two behavioral rules that most often cause bad writes. Dense but not padded; the only mild redundancy is the closing supersedes sentence, whose ground is partly covered by the schema's supersedes description.

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 14-parameter write tool with no annotations and no output schema, this is close to complete: it covers what to save, what to skip, deduplication, and correction handling. The missing piece is the return value or confirmation behavior, which an agent would otherwise have to discover empirically.

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% across 14 parameters, so the schema baseline is already 3; the description adds cross-parameter behavior the schema cannot express — that reusing an existing slug performs an update, that supersedes replaces rather than cross-references (contrasted with 'related'), and that trackers follow a one-per-entity update pattern. It does not restate field-level detail, which is correct given the rich schema.

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?

Opens with a specific verb and scope: 'Persist a new fact, rule, preference, or lesson to the memory store for future sessions.' An agent immediately understands this is the write path for durable knowledge, which inherently separates it from read-side siblings like get_memory, list_memories, and search_memories without needing them named.

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?

Gives an explicit positive trigger ('CALL THIS: whenever you learn something the user would want you to remember next time') with an enumerated list of qualifying cases, and an explicit exclusion ('Do NOT save ephemeral or task-specific details; save durable facts only'). It also resolves a real routing ambiguity — use 'supersedes' rather than writing 'CORRECTED:' prefixes or leaving stale duplicates.

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