Add a reference
traceable_library_add_referenceAttach 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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code_or_id | No | Reference Library item REF code (e.g. REF-00001A) or its UUID | |
| documentId | Yes | The document to add the reference to | |
| targetDocumentId | No | Instead of a library item, cite another document by its UUID | |
| referencedVersion | No | Pin a specific version (default: the target's current/published version) |