Skip to main content
Glama

memory_add

Store team-wide standing preferences, constraints, and directives that get injected into every dispatched agent's prompt, so cross-task rules no longer need to be copied into each prompt by hand.

Instructions

Add a direction-layer memory — the team's shared, cross-task standing preferences.

The direction layer = low-frequency, high value-density, cross-task long-lived preferences/corrections/constraints/design intent. Every dispatched agent is injected with the direction layer at birth, so preferences like "everything in Chinese" and "report as soon as done" no longer need to be hand-copied into prompts.

Write test (soft threshold): how many future tasks can this entry affect? One that affects only a single task → goes to task_memo_add (the episodic layer); do not write it here.

The volume red line is a single axis: storage cap = injection budget. The direction layer counts character quotas per bucket — global 1200 characters + each project 1500 characters + user 300 characters; one session actually inherits 3000 characters; a single entry is still ≤ 400 characters. Whatever fits in storage is guaranteed to be delivered, and what cannot be written truly has no room: when over the limit, this tool returns that bucket's full set of valid entries (id / kind / character count / full text) + the usage gap, requiring you to first, in the same round, memory_invalidate (locatable via a content_match substring) or memory_reconcile_apply to free space, then retry this write. Rewrite over-long content into a pointer entry of the form "trigger condition + pointer to the authoritative file" (e.g. "When production/clusters/DB are involved, follow the read-only iron rule; see ~/.claude/CLAUDE.md"), with the body externalized.

Write-side safety scan: direction-layer entries enter every dispatched agent's system prompt, so invisible Unicode, prompt-injection phrasings (overriding existing instructions / extracting the system prompt / forging conversation roles), and credential shapes are uniformly refused storage.

The four kinds (which determine the injection truncation priority constraint>design>directive>preference):

  • constraint (prohibitions/guardrails): one sentence, machine-checkable, valid for life. E.g. "All output in Chinese", "Never automatically add an agent signature to git commits".

  • design (value ordering/design intent): the basis for trade-offs when no explicit instruction exists. E.g. "Technical decisions favor quality/simplicity/robustness/long-term maintainability, with little weight on development cost".

  • directive (methodology/working style): answers "how to do it". E.g. "On completion, report by problem → root cause → solution → verification; do not batch things up".

  • preference (format preferences): optional, e.g. "One sentence per line for easy diffing".

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
kindNoconstraint / design / directive / preferencepreference
scopeNoglobal / project (the current project) / user (user level). Before writing to global, ask yourself: **does this hold for any session in any directory?** Anything mentioning a specific project/repo/manuscript/task is uniformly scope=project — an unregistered directory falls into this directory's fingerprint temporary bucket ("dir:..."), inherited only by this directory's sessions and never broadcast as a global memory.global
contentYesthe memory content (a single entry ≤ 400 characters, and it must fit this bucket's character
supersedesNooptional, the old memory id this entry replaces and invalidates (a changed preference = the
source_refsNooptional, a list of provenance ids (pointing back to memos/reports/meetings; used at

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.11.2

TDQS

A4/5.0
Behavior3/5

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

With zero annotations the description carries the full burden and does disclose substantial behavior: per-bucket character caps (global 1200 / project 1500 / user 300 / 400 per entry), the over-limit response returning full entries plus usage gap, required remediation via memory_invalidate or memory_reconcile_apply in the same round, and a safety scan rejecting Unicode tricks and credentials. These are valuable, non-obvious traits. It stops short of stating auth requirements or the exact return shape, so a 3 rather than higher.

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

Conciseness3/5

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

Front-loads purpose well and every section is informative, but the body is long, with redundant restatements of the storage-cap reasoning and heavy inline bolding that slows scanning. The valuable content is present but not as tight as it could be.

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?

An output schema exists, so return values needn't be explained, and the description covers write test, capacity behavior, safety scan, and kind semantics thoroughly. Minor gaps like permission/auth preconditions keep it from a 5.

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 coverage is 100%, so the schema already documents all five parameters, and the baseline is 3. The description adds real meaning for 'kind' by explaining each of the four kinds and their injection truncation priority (constraint>design>directive>preference), but 'supersedes' and 'source_refs' get no added explanation beyond the 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?

States a specific verb and resource ('Add a direction-layer memory') and immediately defines the layer as 'the team's shared, cross-task standing preferences.' It explicitly distinguishes itself from the episodic sibling task_memo_add, so an agent can tell which write tool to use without opening the schema.

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 routing test ('how many future tasks can this entry affect?') and names the alternative (task_memo_add) for single-task entries. It also specifies when to use global vs project scope and the four qualified kinds, so the conditions for use and non-use are clear.

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

Deploy Server

Other Tools