Skip to main content
Glama

Link Memories

link_memories

Create typed, directional relationships between two memories to build a knowledge graph that connects related concepts and clarifies dependencies, replacements, or references.

Instructions

Create a typed relationship between two memories.

Use this to build a knowledge graph connecting related concepts. Relationships are directional: from_memory -[relation_type]-> to_memory.

Examples:

  • "Python 3.12 features" -[supersedes]-> "Python 3.11 features"

  • "Auth implementation" -[depends_on]-> "Database schema"

  • "API endpoint details" -[elaborates]-> "API overview"

  • "Project notes" -[mentions]-> "PostgreSQL" (entity extraction)

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": {
      "from_memory_id": "<from_memory_id>",
      "to_memory_id": "<to_memory_id>",
      "relation_type": "<relation_type>"
    },
    "name": "link_memories"
  }
}

Input Schema

NameRequiredDescriptionDefault
to_memory_idYesTarget memory ID
relation_typeYesRelationship type: 'relates_to' (general), 'depends_on' (prerequisite), 'supersedes' (replaces), 'refines' (more specific), 'contradicts' (conflict), 'elaborates' (more detail), 'mentions' (references entity)
from_memory_idYesSource memory ID

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description usefully establishes that this is a creation operation and that the resulting relationship is typed and directional. It does not address operational behavior such as whether both memories must already exist, whether duplicate links or self-links are permitted, or how cycles and invalid IDs are handled.

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 purpose and use case are front-loaded, followed immediately by the essential directionality rule. The four short examples illustrate distinct relationship semantics without unnecessary exposition.

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 flat three-parameter tool with complete schema documentation and an output schema, the description provides enough purpose, directionality, and examples to support correct invocation. Its remaining gaps are mainly ID acquisition and edge-case behavior rather than missing return-value documentation.

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 already 100%, but the directional notation clarifies how the source ID, target ID, and relation type combine. The concrete examples add practical meaning to several relation types, though the description does not explain where callers should obtain valid memory IDs.

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 opening sentence gives a specific verb and resource: creating a typed relationship between two memories. The knowledge-graph and directionality details clarify the operation, although the description does not explicitly differentiate it from siblings such as remember or get_related_memories.

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?

"Use this to build a knowledge graph connecting related concepts" supplies a clear use case, and the examples illustrate several appropriate relationship scenarios. There is no explicit when-not guidance or named alternative for operations such as retrieving or traversing existing links.

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