Artifact Links
Read, create, and remove the typed, directional relationships between artifacts
Overview
An artifact link is a typed, directional relationship from a source artifact to a target artifact. Links are how Closedloop records that a PRD produced an issue, that an issue produced the plan written from it, or that one artifact blocks another.
| Tool | Scope | Purpose |
|---|---|---|
list-artifact-links | read | List an artifact's links, directly or as a tree |
create-artifact-link | write | Create a link |
delete-artifact-link | delete | Remove one link by its id |
Scopes do not imply each other, so a grant needs delete itself to be offered delete-artifact-link. Branch artifacts have their own tool; see Branch Artifacts.
Every tool returns its result as JSON text. A failure comes back as a tool result with isError: true whose text carries a title, a description, any remediation steps, and the error code, message, and timestamp when the API supplied them.
Link types
linkType | Meaning |
|---|---|
PRODUCES | The source produces or derives the target, for example a PRD produces an issue. This is the only type that establishes parent-to-child lineage and drives the project tree. |
BLOCKS | The source blocks the target: the target cannot proceed until the source is done. Directional, but not lineage. |
RELATES_TO | A non-hierarchical association between peers. Direction carries no special meaning. |
Identifiers
Documents can be named by UUID or slug (PRD-7, PLN-4, ISS-42; legacy FEA-42 still resolves). Other artifacts, such as pull requests and deployments, must be named by UUID.
List Artifact Links
Tool: list-artifact-links
Scope: read
Underlying API: GET /artifact-links/resolved
| Name | Type | Required | Description |
|---|---|---|---|
artifactId | string | Yes | The artifact whose links to list: UUID or document slug. |
linkType | PRODUCES | BLOCKS | RELATES_TO | No | Only links of this type. |
direction | source | target | both | No | Names the other endpoint's role. target returns outgoing links where artifactId is the source (its children). source returns incoming links where artifactId is the target (its producers). both, the default, returns all. |
mode | direct | tree | No | direct returns immediate links only. tree walks the link graph breadth-first. |
maxDepth | integer | No | Traversal depth for mode: "tree", 1–10. With direction both (or omitted) the tree is limited to depth 2 and uses 2 when maxDepth is omitted. |
limit | integer | No | Links to return, 1–100. Default 25. |
offset | integer | No | Starting offset, minimum 0. Default 0. |
The tool follows every page of the API's results itself, then applies limit and offset, so total counts every matching link.
Returns
A paginated envelope. Each link carries both endpoints, hydrated:
{
"total": 1,
"offset": 0,
"limit": 25,
"returned": 1,
"hasMore": false,
"nextOffset": null,
"items": [
{
"id": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
"linkType": "PRODUCES",
"createdAt": "2026-10-02T15:04:05.000Z",
"source": {
"id": "9b2c...",
"type": "DOCUMENT",
"subtype": "FEATURE",
"name": "Saved carts",
"slug": "ISS-42",
"externalUrl": null
},
"target": {
"id": "c1d4...",
"type": "DOCUMENT",
"subtype": "IMPLEMENTATION_PLAN",
"name": "Saved carts plan",
"slug": "PLN-12",
"externalUrl": null
}
}
]
}A link whose other endpoint is an agent session can also carry a sessionEvidence object with the attribution evidence the API reported. It is omitted when the API sent none or it could not be read.
Errors
mode: "tree"withdirectionboth(or omitted) and amaxDepthabove 2 is refused with a message naming the limit. Passdirection: "source"or"target"to walk deeper.- An artifact that is not in your organization returns not found.
Example
list-artifact-links(artifactId: "PRD-7", direction: "target", mode: "tree", maxDepth: 3)Create Artifact Link
Tool: create-artifact-link
Scope: write
Underlying API: POST /artifact-links
| Name | Type | Required | Description |
|---|---|---|---|
sourceId | string | Yes | The upstream artifact (the parent for PRODUCES): UUID or document slug. |
targetId | string | Yes | The downstream artifact (the child for PRODUCES): UUID or document slug. |
linkType | PRODUCES | BLOCKS | RELATES_TO | Yes | The relationship type. |
For example, if you read issue ISS-42 and wrote plan PLN-12 from it, link sourceId: "ISS-42", targetId: "PLN-12", linkType: "PRODUCES".
Returns
{
"id": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
"linkType": "PRODUCES",
"createdAt": "2026-10-02T15:04:05.000Z",
"sourceId": "9b2c...",
"targetId": "c1d4..."
}sourceId and targetId are the resolved artifact UUIDs. Keep id: it is what delete-artifact-link takes.
Errors
| Status | Cause |
|---|---|
400 | sourceId and targetId are the same artifact (An artifact cannot be linked to itself). |
400 | A PRODUCES link that would create a cycle (Placement would create a cycle). |
400 | A PRODUCES link that would push the project tree past four levels (Placement exceeds the four-level hierarchy). |
404 | The source or target artifact was not found in your organization. |
409 | The same link already exists (This artifact link already exists). |
The tool also reports an error if the API answered with success but no link record.
Example
create-artifact-link(sourceId: "ISS-42", targetId: "PLN-12", linkType: "PRODUCES")Delete Artifact Link
Tool: delete-artifact-link
Scope: delete
Underlying API: DELETE /artifact-links/{linkId}
Removes one relationship, named by the link's own id, not by the artifacts it connects.
| Name | Type | Required | Description |
|---|---|---|---|
linkId | string (UUID) | Yes | The id of a link from list-artifact-links or create-artifact-link. |
Removing a PRODUCES link changes lineage, so the child stops appearing under its parent in the project tree. To re-parent an artifact, create the new PRODUCES link first and delete the old one second, so the child is never left without a parent.
Returns
{ "deleted": true }Deleting a link that is already gone also returns this, so retries are safe.
Errors
- A
linkIdthat is not a UUID is rejected by the tool schema.
Example
delete-artifact-link(linkId: "3f2504e0-4f89-11d3-9a0c-0305e82c3301")