Create document link
create-document-linkLinks 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
| Name | Required | Description | Default |
|---|---|---|---|
| document_uuid | Yes | UUID 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_type | Yes | How 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_uuid | Yes | UUID of the document to link document_uuid to. Must be a different document. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | No | Identifier 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 | |
| document | No | The document given as document_uuid, from whose side relationship is read | |
| created_at | No | When the documents were linked | |
| relationship | No | How 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_document | No | The other document of the link |