Skip to main content
Glama

link_memories

Idempotent

Create a queryable edge between two memories to track relationships in the graph and enable get_relations() queries. Validates uids and prevents self-links or duplicates with clear errors.

Instructions

Create a queryable edge between two memories.

This is what splitting a body into several memories costs: a [[uid]] written inside prose is a reference a reader follows, and only an edge created here is visible to get_relations() and to the graph.

Refuses an unknown uid, a memory related to itself, and an edge that already exists with that same type -- each as {"ok": False, "errors": [...]}, so a typo comes back as something to fix instead of a dangling edge or a raw database error.

Input Schema

NameRequiredDescriptionDefault
noteNowhy the two are related, kept on the edge.
to_uidYesthe memory it points to.
from_uidYesthe memory the edge starts at.
relation_typeYesfree text, but keep it consistent, e.g. 'supersedes', 'relates_to', 'contradicts', 'links_to'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.16.1
    • addedInput schema / properties / from_uid / description
      Added value: +"the memory the edge starts at."
    • removedInput schema / properties / from_uid / title
      Removed value: -"From Uid"
    • addedInput schema / properties / note / description
      Added value: +"why the two are related, kept on the edge."
    • removedInput schema / properties / note / title
      Removed value: -"Note"
    • addedInput schema / properties / relation_type / description
      Added value: +"free text, but keep it consistent, e.g. 'supersedes', 'relates_to', 'contradicts', 'links_to'."
    • removedInput schema / properties / relation_type / title
      Removed value: -"Relation Type"
    • addedInput schema / properties / to_uid / description
      Added value: +"the memory it points to."
    • removedInput schema / properties / to_uid / title
      Removed value: -"To Uid"
    • removedInput schema / title
      Removed value: -"link_memoriesArguments"
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare the safety profile (not read-only, not destructive, idempotent, closed-world), so the bar is lower. The description adds real value beyond that: the exact error contract ({"ok": False, "errors": [...]}) and the three validation rejections. It's consistent with idempotentHint since a refused duplicate leaves state unchanged. It doesn't describe the success return shape, which is the only notable gap.

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?

The core action is front-loaded in the first sentence, followed by a short rationale and then the error behavior. The middle paragraph is slightly literary ('This is what splitting a body into several memories costs') and indirect, but it earns its place by justifying when the tool matters.

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 create-link tool with full schema coverage and annotations, the description covers purpose, validation errors, and the differentiator from prose references. There is no output schema, so a brief note on the success response would round it out, but nothing essential to correct invocation is missing.

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 description coverage is 100%, so all four parameters are already documented in the schema (including the note field's purpose and the relation_type advice). The description adds conceptual framing of the edge's directionality but no syntax or format detail beyond what the schema provides. Baseline 3 is correct here.

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 ('Create a queryable edge between two memories') and immediately distinguishes it from an adjacent concept: a [[uid]] in prose versus an edge, the latter being what get_relations() and the graph can see. An agent can tell this apart from sibling tools like get_relations or diagram_edge without opening any schema.

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?

Gives a clear reason to choose this tool over the prose-reference alternative by naming the downstream consumer (get_relations(), the graph). It also enumerates the refusal conditions (unknown uid, self-relation, duplicate edge), which effectively tells the agent what inputs are out of scope. It stops short of naming sibling tools to prefer for other linking needs, so it's not a full when/when-not.

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