Skip to main content
Glama

add_reference

Idempotent

Create a typed reference edge between threads or messages in the same workspace, validating existence, workspace boundaries, duplicates, and cycles before returning the stored reference.

Instructions

Create a typed edge from a source thread or message to a destination thread or message in the same workspace, and return the reference (id, src_kind, src_id, dst_kind, dst_id, relation, created_at). Refused when both ends are the same entity, an end does not exist, the ends are in different workspaces, the identical edge exists already, or a depends, supersedes or duplicates edge would close a cycle. Appends a ReferenceAdded event; read edges back with list_references. For task ordering that holds back claim_next use add_thread_dependency instead. Requires workspace:write and read access to both ends.

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": {
      "src_kind": "<src_kind>",
      "src_id": "<src_id>",
      "dst_kind": "<dst_kind>",
      "dst_id": "<dst_id>",
      "relation": "<relation>"
    },
    "name": "add_reference"
  }
}

Input Schema

NameRequiredDescriptionDefault
dst_idYesUUID of the destination thread or message, as chosen by dst_kind. You must be able to read it.
src_idYesUUID of the source thread or message, as chosen by src_kind. You must be able to read it.
dst_kindYesWhat dst_id names: thread or message.
relationYesRelation name from the src end to the dst end. Controlled set: supports, refutes, defines, depends, duplicates, grounds, supersedes, seeded_from. Any other string is accepted and stored as given.
src_kindYesWhat src_id names: thread or message.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv479.0.2
    • addedInput schema / properties / dst_id / description
      Added value: +"UUID of the destination thread or message, as chosen by dst_kind. You must be able to read it."
    • addedInput schema / properties / dst_kind / description
      Added value: +"What dst_id names: thread or message."
    • changedInput schema / properties / relation / description
      Previous value: -"typed relation; controlled set: supports/refutes/defines/depends/duplicates/grounds/supersedes (other values are allowed and round-trip verbatim)"New value: +"Relation name from the src end to the dst end. Controlled set: supports, refutes, defines, depends, duplicates, grounds, supersedes, seeded_from. Any other string is accepted and stored as given."
    • addedInput schema / properties / src_id / description
      Added value: +"UUID of the source thread or message, as chosen by src_kind. You must be able to read it."
    • addedInput schema / properties / src_kind / description
      Added value: +"What src_id names: thread or message."
  2. First observedv479.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the side effect ('Appends a ReferenceAdded event'), the permission requirements ('workspace:write and read access to both ends'), and a full list of rejection cases including cycle detection for specific relation types. This is consistent with the supplied annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=true) — refusing duplicate edges matches the idempotent hint rather than contradicting it.

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 sentences, each load-bearing: creation and return shape first, then refusals, then the side effect and alternative, then permissions. The inline return tuple compensates for the absent output schema rather than padding.

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

Completeness5/5

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

With no output schema, the description supplies the return shape (id, src_kind, src_id, dst_kind, dst_id, relation, created_at), plus side effects, failure modes, authorization requirements, and sibling alternatives. Nothing an agent needs in order to call this five-required-parameter mutation correctly is missing.

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, but the description adds meaning the schema does not fully convey: the workspace-match constraint on src_id/dst_id and the relation-specific cycle rules for depends, supersedes, and duplicates. The rest of the parameter behavior (enum kinds, relation names) is already in the schema, so it stops short of a 5.

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?

The description opens with a specific verb and resource: 'Create a typed edge from a source thread or message to a destination thread or message in the same workspace.' It also names the two most likely confusable siblings (list_references, add_thread_dependency) and states how this tool differs from each, so an agent can disambiguate 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?

It explicitly routes the agent: use list_references to read edges back, and use add_thread_dependency for 'task ordering that holds back claim_next.' It also enumerates the refusal conditions (same-entity ends, missing end, cross-workspace, duplicate edge, cycle-closing depends/supersedes/duplicates), which tells the agent exactly when a call will fail.

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

Deploy Server

Other Tools