Skip to main content
Glama
engram
by TushaeBXN

engram_link

Link two stored memories with a defined relation (based_on, derived_from, contradicts, or supersedes) to capture evidence, inference, conflict, or replacement; undo links with confirmation.

Instructions

Record how two stored memories relate: 'memory_id target_id'. based_on: target is evidence for memory. derived_from: memory was inferred from target. contradicts: they conflict, undecided. supersedes: memory replaces target. undo=true removes the link: that returns a preview unless confirm=true and a reason are given, and the removal is logged. Safe to retry.

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": {
      "memory_id": "<memory_id>",
      "relation": "<relation>",
      "target_id": "<target_id>"
    },
    "name": "engram_link"
  }
}

Input Schema

NameRequiredDescriptionDefault
undoNo
reasonNoWhy they are linked, or why the link is removed (required to confirm an undo)
confirmNoApply the change. Without it the tool only returns a preview of what would change and changes nothing
relationYes
memory_idYes
target_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.12.0
    • addedInput schema / properties / confirm
      Added value: +{
      +  "default": false,
      +  "description": "Apply the change. Without it the tool only returns a preview of what would change and changes nothing",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / reason / description
      Added value: +"Why they are linked, or why the link is removed (required to confirm an undo)"
  2. Addedv1.10.5

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and largely meets it: it discloses that undo is a destructive removal, that it shows a preview unless confirm=true plus a reason, and that removals are logged, plus an idempotency claim ("Safe to retry"). The gap is that confirm/reason gating is described only for undo, leaving ambiguous whether creating a link also requires confirmation, and no permission or duplicate-link behavior is stated.

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?

Front-loaded with the core operation and the relation glossary, with no filler sentences. The undo clause ("that returns a preview unless confirm=true and a reason are given, and the removal is logged") is densely packed and slightly tangled in its clause ordering, but nothing is wasted.

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 6-parameter mutation with no annotations and no output schema, the description covers the important behavior: relation semantics, confirmation gating, audit logging, and retry safety. It stops short of describing what a successful link or a preview returns, and whether re-linking the same pair is idempotent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 33%, yet the description compensates for nearly every parameter: the four enum values of relation are each defined, undo and confirm are explained with their interaction, reason is tied to undo confirmation, and memory_id/target_id direction is fixed by the template and per-relation phrasing.

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?

States a specific verb and resource ("Record how two stored memories relate") and even gives the canonical shape "memory_id <relation> target_id". It defines all four relation semantics, so the agent understands what it is writing, though it never names a sibling (engram_supersede, engram_kg_add) to distinguish itself from them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage guidance is embedded in the relation glossary: based_on vs derived_from vs contradicts vs supersedes each carry a directional test ("target is evidence for memory", "memory replaces target"), so an agent can pick the right relation. The undo path is also spelled out. What is missing is any explicit when-not or alternative-tool routing, e.g. versus engram_supersede.

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