Skip to main content
Glama
persistent-memory-mcp

persistent-memory-mcp

Correct an artifact

memory_correct

Replace an artifact's text after a user correction while preserving history and enforcing version checks, so stale edits are refused instead of overwriting newer content.

Instructions

Replace an artifact's text when the user corrects it, keeping its history. Only applies if expected_version is still its current version; otherwise it is refused with version_conflict, and you search again. Metadata you leave out is kept. Whatever was derived from the old version stops being served and its readers are notified. To remove something entirely, use memory_withdraw.

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": {
      "artifact_id": "<artifact_id>",
      "text": "<text>",
      "expected_version": "<expected_version>"
    },
    "name": "memory_correct"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe corrected statement.
aliasesNoShort names to find it again.
parentsNoFor a derived artifact: its new parents. Leave out to keep them.
confidenceNoDeclared, not computed. Leave out unless the user gave one.
valid_fromNoUTC time it starts to apply, e.g. 2026-01-31T00:00:00Z. Leave out unless the user gave one; by default it applies now.
artifact_idYesThe artifact_id returned when it was stored or found by memory_search.
valid_untilNoUTC time after which it no longer applies. Leave out unless the user gave one.
preconditionsNoExact conditions a search must supply to see it. Leave out unless the user said it only holds under a condition: a search without these conditions will not return it.
expected_versionYesThe version_id of the ref you read.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only give generic hints (destructiveHint=false, idempotentHint=false); the description adds real behavior: optimistic concurrency gated on expected_version, the version_conflict refusal and recovery path, metadata merge semantics ('Metadata you leave out is kept'), and downstream effects ('whatever was derived from the old version stops being served and its readers are notified'). The downstream invalidation is exactly the kind of non-obvious consequence an agent cannot infer from 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?

Four short sentences, front-loaded with purpose, then guard condition, then merge semantics, then the alternative tool. No filler and no restatement of the title or schema.

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 9-parameter, nested-schema mutation with no output schema, the description covers the risky parts: versioning, conflict recovery, merge behavior, and downstream invalidation. The notable gap is the return value — with no output schema, an agent is not told that the call yields a new version/ref it will need for subsequent corrections or expected_version values.

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 the baseline is 3 and the schema already defines every parameter. The description still adds meaning the schema does not state globally: that omitted metadata is preserved rather than cleared (a merge, not a replace), and that expected_version is the guard that produces version_conflict. It stops short of explaining the parents/relation invalidation semantics, which stay in 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 ('Replace an artifact's text') plus the triggering condition ('when the user corrects it') and the retention effect ('keeping its history'). It also names the sibling it is not (memory_withdraw) for the delete case, so an agent can distinguish correction from withdrawal without opening a 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?

Explicit when-to-use (user corrects an artifact), explicit alternative for a different intent ('To remove something entirely, use memory_withdraw'), and explicit failure handling ('otherwise it is refused with version_conflict, and you search again'). This is close to a complete decision procedure for the sibling set.

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