Skip to main content
Glama

Create document link

create-document-link

Links two existing documents, recording how they relate to each other, e.g. that one contract is a renewal of another.

Use this tool when:

  • The user says how two contracts relate, e.g. "this is the renewal of the 2023 service agreement" or "link the amendment to its main contract"

  • Documents migrated from another system belong together, e.g. a framework agreement and the order forms under it (parent_of / child_of)

relationship_type is read from document_uuid's side: renewal_of means document_uuid renews other_document_uuid, renewed_by means other_document_uuid renews document_uuid. Find both documents' UUIDs with list-documents first. Two documents can be linked only once with each kind of relationship.

The documents already linked to a document are returned by get-document-info with include linked_documents. To change a link's relationship type, remove the link with delete-document-link and create the right one.

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": {
      "document_uuid": "<document_uuid>",
      "other_document_uuid": "<other_document_uuid>",
      "relationship_type": "<relationship_type>"
    },
    "name": "create-document-link"
  }
}

Input Schema

NameRequiredDescriptionDefault
document_uuidYesUUID of the document whose side relationship_type is read from. If you don't already have the document's UUID, use the list-documents tool to find it.
relationship_typeYesHow document_uuid relates to other_document_uuid, e.g. renewal_of when document_uuid is the renewal, amended_by when other_document_uuid is the amendment.
other_document_uuidYesUUID of the document to link document_uuid to. Must be a different document.

Output Schema

NameRequiredDescriptionDefault
uuidNoIdentifier of the link itself, not of either document, as taken by delete-document-link. Do not show to the user unless they ask for it
documentNoThe document given as document_uuid, from whose side relationship is read
created_atNoWhen the documents were linked
relationshipNoHow the document the link is presented from relates to linked_document, e.g. renewal_of means it renews linked_document, renewed_by means linked_document renews it
linked_documentNoThe other document of the link

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover the mutation/idempotency profile; the description adds the real operational constraints: relationship_type is directional from document_uuid's side, and a pair can be linked only once per relationship kind. It also explains how existing links surface (get-document-info) and that changing a type requires delete-then-create, which is exactly the behavior an agent needs before mutating.

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 purpose, then cleanly sectioned into when-to-use, parameter semantics, and follow-up actions. A few lines duplicate schema content (the list-documents hint for UUIDs), which is the only thing keeping it from a 5.

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?

For a 3-parameter mutation with an output schema and full annotation coverage, nothing an agent needs is missing: when to call it, which side the enum reads from, the once-per-pair uniqueness rule, and how to undo or amend an existing link.

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 this clears the baseline 3. The description still adds value by spelling out the reading direction of relationship_type (renewal_of means document_uuid renews other_document_uuid) and restating the distinct-documents constraint, though parts of that overlap with the enum's own schema description.

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?

Opens with a specific verb and resource ('Links two existing documents') plus a concrete illustrative example (one contract is a renewal of another). This clearly separates it from the surrounding create-* siblings, which create new documents rather than relating existing ones.

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?

An explicit 'Use this tool when:' list gives two triggering scenarios in user language ('this is the renewal of the 2023 service agreement'). It also names alternatives for adjacent needs: list-documents to find UUIDs, get-document-info with linked_documents to inspect links, and delete-document-link plus re-create to change a link's type.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources