Skip to main content
Glama

write_memory

Create or update curated memory files in the memory tree to persist durable decisions, constraints, or conventions, using an expect guard to prevent accidental overwrites.

Instructions

MUTATING: create or update one curated memory file in the memory tree, addressed as docmancer://memory/. Writes to local disk and appends to the change timeline; never silently clobbers, because the expect guard decides whether an existing file may be replaced. Use it to record a durable decision, constraint, or convention. Not for correcting the reconciled canonical memory about the user, which is regenerated and would discard the edit: use pin_memory for that. To change only the body of an existing file, prefer edit_memory. Parameters: relative_path is the file's path in the tree and must include the Markdown suffix; text is the full Markdown body; expect is the write guard, 'absent' (default) to create only and fail if the path exists, or the current content_hash to permit a guarded overwrite; memory_type, scope, authority, status, and curation_origin are frontmatter labels described in the schema; project_id names the owning project; sources lists backing file paths or URLs; tags lists retrieval labels; project_path project root whose memory tree the operation applies to. Omit it to use the machine-wide tree, and always omit it when this server was started pinned to a project. Returns an object with the stable address, the new content_hash, and the revision id, all of which later guarded calls need.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNoLabels used to classify and retrieve the memory content.
textYesMarkdown body to write or replace. Replaces the body wholesale; it is not appended.
scopeNoMemory visibility scope stored in frontmatter. Use global for machine-wide memory or project for project-scoped memory.global
expectNoCreate/update guard, and not an enum: pass the literal string absent for create-only, or the file's current content_hash for a guarded update.absent
statusNoFree-form lifecycle status stored in frontmatter. Only active entries are recalled. Defaults to active.active
sourcesNoSource references that back the memory content.
authorityNoHow binding the memory is. mandatory entries are always included in a recall bundle; advisory entries compete on relevance. Defaults to advisory.advisory
project_idNoProject identifier stored in the memory file frontmatter. Omit unless the memory belongs to a named project.
memory_typeNoFree-form memory classification stored in frontmatter. Defaults to fact.fact
project_pathNoProject root whose memory tree the operation applies to. Omit it to use the machine-wide tree, and always omit it when this server was started pinned to a project.
relative_pathYesRelative path, including the .md suffix, for the memory file inside its selected memory tree.
curation_originNoFree-form origin label stored in frontmatter recording how the memory was created. Defaults to deliberate_write.deliberate_write

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.9.16
    • changedInput schema / properties / memory_type / description
      Previous value: -"Free-form memory classification stored in frontmatter, such as fact, decision, preference, or constraint. Defaults to fact."New value: +"Free-form memory classification stored in frontmatter. Defaults to fact."
    • changedInput schema / properties / sources / description
      Previous value: -"Source references, such as file paths or URLs, that back the memory content."New value: +"Source references that back the memory content."
    • changedInput schema / properties / status / description
      Previous value: -"Free-form lifecycle status stored in frontmatter, such as active, draft, or archived. Only active entries are recalled. Defaults to active."New value: +"Free-form lifecycle status stored in frontmatter. Only active entries are recalled. Defaults to active."
  2. Changed25 schema fields changedv0.9.13
    • addedInput schema / properties / authority / description
      Added value: +"How binding the memory is. mandatory entries are always included in a recall bundle; advisory entries compete on relevance. Defaults to advisory."
    • addedInput schema / properties / authority / enum
      Added value: +[
      +  "advisory",
      +  "mandatory"
      +]
    • removedInput schema / properties / content
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Content"
      -}
    • addedInput schema / properties / curation_origin / description
      Added value: +"Free-form origin label stored in frontmatter recording how the memory was created. Defaults to deliberate_write."
    • removedInput schema / properties / expect / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / expect / description
      Added value: +"Create/update guard, and not an enum: pass the literal string absent for create-only, or the file's current content_hash for a guarded update."
    • addedInput schema / properties / expect / type
      Added value: +"string"
    • addedInput schema / properties / memory_type / description
      Added value: +"Free-form memory classification stored in frontmatter, such as fact, decision, preference, or constraint. Defaults to fact."
    • removedInput schema / properties / path
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Path"
      -}
    • addedInput schema / properties / project_id / description
      Added value: +"Project identifier stored in the memory file frontmatter. Omit unless the memory belongs to a named project."
    • addedInput schema / properties / project_path / description
      Added value: +"Project root whose memory tree the operation applies to. Omit it to use the machine-wide tree, and always omit it when this server was started pinned to a project."
    • removedInput schema / properties / relative_path / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / relative_path / default
      Removed value: -null
    • addedInput schema / properties / relative_path / description
      Added value: +"Relative path, including the .md suffix, for the memory file inside its selected memory tree."
    • addedInput schema / properties / relative_path / type
      Added value: +"string"
    • addedInput schema / properties / scope / description
      Added value: +"Memory visibility scope stored in frontmatter. Use global for machine-wide memory or project for project-scoped memory."
    • addedInput schema / properties / scope / enum
      Added value: +[
      +  "global",
      +  "project"
      +]
    • addedInput schema / properties / sources / description
      Added value: +"Source references, such as file paths or URLs, that back the memory content."
    • addedInput schema / properties / status / description
      Added value: +"Free-form lifecycle status stored in frontmatter, such as active, draft, or archived. Only active entries are recalled. Defaults to active."
    • addedInput schema / properties / tags / description
      Added value: +"Labels used to classify and retrieve the memory content."
    • removedInput schema / properties / text / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / text / default
      Removed value: -null
    • addedInput schema / properties / text / description
      Added value: +"Markdown body to write or replace. Replaces the body wholesale; it is not appended."
    • addedInput schema / properties / text / type
      Added value: +"string"
    • addedInput schema / required
      Added value: +[
      +  "relative_path",
      +  "text"
      +]
  3. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond annotations, it discloses 'Writes to local disk and appends to the change timeline; never silently clobbers, because the expect guard decides whether an existing file may be replaced.' It also explains the canonical-memory regeneration pitfall and the return object, adding meaningful behavioral context without contradicting annotations.

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

Conciseness5/5

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

The description is dense but front-loaded with the mutation warning and core purpose, then flows into usage guidance, alternatives, and parameter explanations. Every section carries unique information; the length is justified for a 12-parameter tool.

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 lacking an output schema, the description names return fields ('stable address, new content_hash, and revision id'), explains the guard behavior, warns about canonical memory, and covers all parameter groups. It is sufficiently complete for a complex write operation with no output schema.

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 baseline is 3. The description adds value by explaining the expect guard mechanics ('absent' default, content_hash for guarded update), requiring the Markdown suffix on relative_path, and offering the project_path caveat about machine-wide vs pinned-project usage. This goes beyond schema paraphrasing.

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 description opens with 'MUTATING: create or update one curated memory file in the memory tree', giving a specific verb, resource, and scope. It also distinguishes itself from siblings by explicitly contrasting with pin_memory and edit_memory.

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?

Provides explicit guidance: 'Use it to record a durable decision, constraint, or convention.' It also states when not to use it ('Not for correcting the reconciled canonical memory... use pin_memory') and when to prefer edit_memory, meeting the full when/when-not/alternatives bar.

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