# memory_update

> 按 id 只更新给出的记忆字段。

URL: https://mcp-docs.opennomos.com/zh/docs/tools/memory/memory_update

> 按 id 只更新给出的记忆字段。kind=null 清除 kind;tags=[] 清除标签。记忆所属的项目不变。

> 以上是服务端发布的英文描述的译文；英文原文见[英文页](https://mcp-docs.opennomos.com/docs/tools/memory/memory_update.md)。工具名、参数名和取值保持原样。

| 字段 | 值 |
| --- | --- |
| 工具包 | Core (`core`) |
| 每次调用的预估成本 | $0 |
| 工具包每月上限 | 无 |
| 项目 | 按顺序确定：显式的 `project` → 请求头 → 凭据默认项目 → 工作区默认项目 |

## 参数

| 参数 | 必填 | 类型 | 说明 |
| --- | --- | --- | --- |
| `content` | 否 | `string` | 记忆文本，最多 4096 字节，例如 'Reddit r/SaaS ignores self-promo; reply with help first.' |
| `kind` | 否 | `string \| null` | 新的分类。null 表示清除；省略则保持不变。 |
| `tags` | 否 | `string[]` | 新的标签列表，替换旧的。[] 表示清除标签；省略则保持不变。 |
| `id` | 是 | `string` | 来自 memory_add 或 memory_search 的记忆 id。 |

## 示例调用

```json
{
  "id": "mem_Zr81nQw3",
  "tags": [
    "reddit",
    "rules",
    "moderation"
  ]
}
```

REST:`POST https://service.opennomos.com/v1/tools/memory_update`，以上 JSON 作为请求体。MCP:`tools/call`,`name: "memory_update"`，以上 JSON 作为 `arguments`。

## 示例结果

示例里的值是示意性的；结构来自服务端代码。

```json
{
  "project": {
    "id": "prj_k3Vd9aQx2",
    "slug": "acme-crm"
  },
  "memory": {
    "id": "mem_Zr81nQw3",
    "kind": "insight",
    "content": "Reddit r/SaaS ignores self-promo; reply with help first.",
    "tags": [
      "reddit",
      "rules",
      "moderation"
    ],
    "source": "Claude Code",
    "created_at": "2026-10-16T09:00:00.000Z",
    "updated_at": "2026-10-16T09:05:00.000Z"
  }
}
```

## 说明

- 只有给出的字段会改变。`kind: null` 清除 kind;`tags: []` 清除标签；`tags` 会替换整个列表。记忆仍属于原来的项目。

## 错误

被拒绝的调用（输入有误、id 未知、触发限流）返回 `message` 和 `code`；走 MCP 时结果带 `isError: true`。见[错误](https://mcp-docs.opennomos.com/zh/docs/reference/errors.md)。
