get_adr_graph
Visualize ADR dependency relationships to understand decision impacts and connections across your architecture documentation.
Instructions
Visualize ADR dependency graph. Optionally scope to a single ADR.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adr_id | No | Focus on a specific ADR (omit for full graph) |
Implementation Reference
- index.js:214-238 (handler)The implementation of the get_adr_graph tool handler, which retrieves and formats ADR relations as a text-based graph.
}, async ({ adr_id }) => { const relations = adr_id ? getADRRelations(adr_id) : getAllRelations(); if (!relations.length) { return { content: [{ type: 'text', text: 'No relations found. Use link_adrs to connect ADRs.' }] }; } const ICONS = { related_to: '↔', conflicts_with: '✕', depends_on: '→' }; // Build adjacency list grouped by relation type const groups = {}; for (const r of relations) { const label = r.relation.replace(/_/g, ' '); if (!groups[label]) groups[label] = []; groups[label].push( ` ADR-${r.from_id} "${r.from_title}" ${ICONS[r.relation] ?? '-'} ADR-${r.to_id} "${r.to_title}"` ); } const output = Object.entries(groups) .map(([label, lines]) => `### ${label}\n${lines.join('\n')}`) .join('\n\n'); return { content: [{ type: 'text', text: `## ADR Dependency Graph\n\n${output}` }] }; }); - index.js:209-213 (registration)Registration of the get_adr_graph tool, including its description and input schema.
server.registerTool('get_adr_graph', { description: 'Visualize ADR dependency graph. Optionally scope to a single ADR.', inputSchema: { adr_id: z.number().optional().describe('Focus on a specific ADR (omit for full graph)'), },