Skip to main content
Glama

Link two memories

link_memory

Create typed relationships between two stored memories to model support, contradiction, supersession, derivation, causality, or dependency in the memory graph.

Instructions

Create a typed relationship between two memories in the graph (supports/contradicts/supersedes/derived_from/related_to/caused_by/depends_on).

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": {
      "sourceId": "<sourceId>",
      "targetId": "<targetId>",
      "relation": "<relation>"
    },
    "name": "link_memory"
  }
}

Input Schema

NameRequiredDescriptionDefault
relationYesLink relation (supports/contradicts/supersedes/derived_from/related_to/caused_by/depends_on)
sourceIdYesSource memory id
targetIdYesTarget memory id

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv2.4.2
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / sourceId / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / sourceId / minimum
      Added value: +-9007199254740991
    • addedInput schema / properties / targetId / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / targetId / minimum
      Added value: +-9007199254740991
  2. First observedv2.2.1

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full disclosure burden. It does not say whether the link is directional (source→target), whether duplicates are rejected or merged, whether it is idempotent, or what happens if an ID does not exist – significant gaps for a mutation tool.

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?

A single front-loaded sentence that names the action and the resource. The parenthetical enum list is redundant with the schema and is the only wasted content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter mutation tool with no annotations and no output schema, the definition covers what is created but not directionality, idempotency, failure modes, or return value. Adequate to attempt a call, incomplete for calling it correctly in edge cases.

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 coverage is 100% and each parameter already has a description, so the baseline is 3. The description repeats the relation enum verbatim without explaining semantics of individual relations (for example, whether 'supersedes' deactivates the target) or which ID is source versus target.

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 states a specific verb and resource: 'Create a typed relationship between two memories in the graph.' The agent can tell this is a graph-edge creation tool, but nothing distinguishes it from siblings like merge_memory or update_memory.

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

Usage Guidelines2/5

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

There is no guidance on when to use this rather than merge_memory, consolidate, or update_memory, and no prerequisites such as both memories needing to already exist. The agent must infer usage entirely from the name and siblings.

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