Skip to main content
Glama

mh_update

Update a memory by ID in place without breaking reference chains. Only provided fields change; new content automatically recalculates vector and hash.

Instructions

按 id 原地更新一条记忆(改错字、补内容、转 pinned、换 category 都用这个)。只改传了的字段,未传的保持不动;改了 content 会自动重算向量与 hash。保留 id,不打断 superseded_by / 冲突记录引用链——优于"删了重写"。改内容前建议先 mh_get 看一眼原文。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes要更新的条目 id
tagsNo给了就整组替换,不给则不动
layerNo
pinnedNotrue/false;不给则不动
sourceNo
contentNo新内容(给了就整条替换并重算向量)
categoryNo
confidenceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly states partial-update semantics (only provided fields change), automatic vector and hash recomputation when content changes, and id preservation that doesn't break superseded_by/conflict reference chains. It doesn't mention error cases or permission requirements, but the core behavioral traits are well disclosed.

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 compact and front-loaded: the first sentence states the action and use cases, the second explains the partial-update semantics and side effects, and the third gives the id-preservation rationale and a practical recommendation. Every sentence earns its place with no filler.

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 an 8-parameter mutation tool with no annotations and no output schema, the description covers the essential behavioral contract: partial updates, side effects, and id preservation. It doesn't describe return values or error conditions, but the core semantics an agent needs to invoke it correctly are present. The recommendation to use mh_get first adds practical completeness.

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 description coverage is 50%, and the description adds meaningful semantics beyond the schema: it explains the in-place partial-update model ('只改传了的字段,未传的保持不动'), the vector/hash recomputation side effect for content, and the id-preservation guarantee. This compensates well for the parameters that lack schema descriptions (layer, source, category, confidence).

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 states a specific verb ('原地更新' / in-place update) and resource ('一条记忆'), and enumerates concrete use cases (fixing typos, supplementing content, toggling pinned, changing category). It also explicitly distinguishes itself from the alternative '删了重写' (delete-and-recreate), which differentiates it from sibling tools like mh_write.

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?

The description gives explicit when-to-use guidance: use this for in-place updates to preserve id and reference chains, and it explicitly recommends reading the original with mh_get before modifying content. It also names the alternative approach ('删了重写') and explains why this tool is superior, giving clear context for when to choose this over other operations.

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