Skip to main content
Glama

memory_write

Capture long-term facts, decisions and procedures as scoped, versioned memory entries with evidence chains so multiple AI agents stay aligned. Search first, then update existing entries.

Instructions

写入一条记忆(默认项目级;scope 可选用户级/设备级/工具级)。HTTP 模式:scope=user 可省 project,其他 scope 必填。写入前先用 memory_search 查找同主题记忆,优先更新而不是新建。只记录有长期价值的内容。

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": {
      "title": "<title>",
      "content": "<content>",
      "kind": "<kind>"
    },
    "name": "memory_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYes
tagsNo标签列表
scopeNo写入作用域:user=用户级(跨项目,project 参数可省)/ project=项目级(默认)/ device=本设备 / agent=本工具。设备与工具名取自请求上下文,勿手输
titleYes简短标题,一句话概括
pinnedNo置顶(进入项目简报)
contentYes记忆正文,markdown。决策要带理由
projectNo项目名或 id。省略时从当前工作目录自动解析
evidenceNo证据链:这条结论从哪来的(最多 12 条)。有外部事实依据时务必填写,日后别人能据此复核
ttl_daysNo有效期(天),到期自动归档;episodic 类建议设置
topic_keyNo主题键(如 "architecture/auth-model")。同项目内同 key 的写入会原地修订既有记忆(revision_count +1),适合演化中的主题;与 supersedes 二选一
importanceNo重要性 0~1,默认 0.5
session_idNo来源会话 id
supersedesNo被本条取代的旧记忆 id;旧记忆自动标记为 superseded,保留历史链
expected_versionNo乐观并发(仅 topic_key 修订时生效):传你读到的 version(上次读取/写入返回的 memory.version),若期间已被其他写入者修订则报 REVISION_CONFLICT 而不是覆盖

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.4

TDQS

A3.9/5.0
Behavior3/5

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

The annotations already declare that this is a non-read-only, non-destructive write, so the safety profile is covered. The description adds real behavior context beyond that: the dedupe-before-write workflow and the HTTP-mode project-omission rule. Revision, supersession, and conflict semantics exist but are carried by the schema's own parameter descriptions rather than this text.

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?

Four short sentences, front-loaded with the core action and default scope, followed by the conditional HTTP rule and the write policy. No sentence is redundant, though the parenthetical scope list partially restates what the enum already conveys.

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 output schema, the description covers the default scope, the HTTP-mode project requirement, the pre-write dedupe step, and the content-value policy. Remaining parameter detail (kind, evidence, ttl_days) is left to a schema that documents it at 93% coverage, so nothing critical 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 93%, so the baseline is 3 and the schema already explains scope, project, topic_key, supersedes, and expected_version in detail. The description adds one genuine piece of meaning the schema lacks: the HTTP-mode rule that only scope=user may omit project. That is a modest increment on top of an already-rich schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ("写入一条记忆", write a memory) and states the default scope (project-level) plus the three optional scopes. It distinguishes itself from siblings by directing the agent to memory_search for deduplication and to update-in-place rather than create anew, though the update sibling is not named explicitly.

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?

It gives explicit when-to-use and when-not-to-use guidance: search for same-topic memories first, prefer updating over creating, and only record content with long-term value. It also states a conditional usage rule for HTTP mode (scope=user may omit project, all other scopes must supply it), leaving nothing about selection to inference.

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