Create Downstream Reference
create_referenceCreate a downstream reference linking two Codebeamer items to establish derivation or traceability. The source item points to the target item as a downstream dependency.
Instructions
Add a downstream reference from one Codebeamer item to another. Downstream references represent derivation/traceability links (e.g. a requirement derived from another). The 'from' item gets the downstream reference pointing to the 'to' item.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fromItemId | Yes | Item ID that will have the downstream reference added | |
| toItemId | Yes | Item ID to reference as downstream |
Implementation Reference
- src/tools/associations-write.ts:59-89 (registration)Registration of the 'create_reference' tool on the MCP server with inputSchema (fromItemId, toItemId) and handler callback.
server.registerTool( "create_reference", { title: "Create Downstream Reference", description: "Add a downstream reference from one Codebeamer item to another. " + "Downstream references represent derivation/traceability links (e.g. a requirement derived from another). " + "The 'from' item gets the downstream reference pointing to the 'to' item.", inputSchema: { fromItemId: z .number() .int() .positive() .describe("Item ID that will have the downstream reference added"), toItemId: z .number() .int() .positive() .describe("Item ID to reference as downstream"), }, }, async ({ fromItemId, toItemId }) => { await client.createDownstreamReference(fromItemId, toItemId); const text = `**Downstream reference created**\n\n` + `| Field | Value |\n|---|---|\n` + `| Upstream (from) | #${fromItemId} |\n` + `| Downstream (to) | #${toItemId} |`; return { content: [{ type: "text", text }] }; }, ); - src/tools/associations-write.ts:80-88 (handler)Handler function for 'create_reference' that calls client.createDownstreamReference(fromItemId, toItemId) and returns a formatted success message.
async ({ fromItemId, toItemId }) => { await client.createDownstreamReference(fromItemId, toItemId); const text = `**Downstream reference created**\n\n` + `| Field | Value |\n|---|---|\n` + `| Upstream (from) | #${fromItemId} |\n` + `| Downstream (to) | #${toItemId} |`; return { content: [{ type: "text", text }] }; }, - Input schema definition for 'create_reference': requires fromItemId and toItemId (positive integers), with title and description metadata.
{ title: "Create Downstream Reference", description: "Add a downstream reference from one Codebeamer item to another. " + "Downstream references represent derivation/traceability links (e.g. a requirement derived from another). " + "The 'from' item gets the downstream reference pointing to the 'to' item.", inputSchema: { fromItemId: z .number() .int() .positive() .describe("Item ID that will have the downstream reference added"), toItemId: z .number() .int() .positive() .describe("Item ID to reference as downstream"), },