Skip to main content
Glama

Add a reference

traceable_library_add_reference
Idempotent

Attach a Reference Library item — or another document — to this document's reference list, and ensure a Reference Table row exists to display it (created at the end of the body if absent). To put the table somewhere else, write [[reference-table]] there first (e.g. with traceable_segment_write); this tool then uses that row rather than adding a second one. Pass code_or_id (a library item's REF code e.g. REF-00001A, or its id — from traceable_library_search) OR targetDocumentId (a document to cite) — exactly one. The referenced version defaults to the target's current/published version; override with referencedVersion. Idempotent: re-adding an existing reference succeeds without duplicating it. Returns the referenceId, which a citation uses: label in any text (see inlineSyntax.citation in traceable_capabilities).

Input Schema

NameRequiredDescriptionDefault
code_or_idNoReference Library item REF code (e.g. REF-00001A) or its UUID
documentIdYesThe document to add the reference to
targetDocumentIdNoInstead of a library item, cite another document by its UUID
referencedVersionNoPin a specific version (default: the target's current/published version)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare non-readOnly, idempotent, non-destructive, but the description discloses a non-obvious side effect the annotations cannot: a Reference Table row is created at the end of the body if absent. It also restates idempotency concretely ('re-adding an existing reference succeeds without duplicating it'), which is real behavioral context.

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?

One dense paragraph that front-loads the primary action and side effect, then folds in routing, exclusivity and the citation syntax. Nothing is padded, though the single-block format makes some secondary rules (e.g. cite:<referenceId> syntax) easy to lose.

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?

There is no output schema, so the description carries the return burden and does so: it names referenceId and shows its use as [label](cite:<referenceId>). Combined with the side-effect and exclusivity notes, an agent has everything needed to call this correctly.

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. The description adds meaning beyond the schema by enforcing mutual exclusivity (exactly one of code_or_id / targetDocumentId), explaining the default for referencedVersion (target's current/published version), and giving the REF-code format example.

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 precise verb and resource: attach a Reference Library item or another document to this document's reference list. It also names the sibling tools involved (traceable_library_search for codes, traceable_segment_write for placing the table), letting an agent separate it from the other traceable_library_* tools.

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?

Explicitly states the exactly-one rule between code_or_id and targetDocumentId, tells the agent to pre-write [[reference-table]] when a non-default location is wanted, and points to traceable_library_search for obtaining codes. When-to-use and the key alternative path are both covered.

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