Skip to main content
Glama

link_adrs

Establish relationships between Architecture Decision Records by linking them as related, conflicting, or dependent to create a clear dependency graph.

Instructions

Create a relationship between two ADRs: related_to, conflicts_with, or depends_on

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_idYesSource ADR ID
to_idYesTarget ADR ID
relationYesRelationship type

Implementation Reference

  • The tool registration and handler implementation for 'link_adrs'. It validates the ADR IDs and calls the 'linkADRs' database helper function.
    server.registerTool('link_adrs', {
      description: 'Create a relationship between two ADRs: related_to, conflicts_with, or depends_on',
      inputSchema: {
        from_id:  z.number().describe('Source ADR ID'),
        to_id:    z.number().describe('Target ADR ID'),
        relation: z.enum(['related_to', 'conflicts_with', 'depends_on']).describe('Relationship type'),
      },
    }, async ({ from_id, to_id, relation }) => {
      if (!getADR(from_id)) throw new Error(`ADR ${from_id} not found`);
      if (!getADR(to_id))   throw new Error(`ADR ${to_id} not found`);
    
      linkADRs(from_id, to_id, relation);
      return { content: [{ type: 'text', text: `Linked: ADR-${from_id} ${relation.replace(/_/g, ' ')} ADR-${to_id}` }] };
    });
  • db.js:95-99 (handler)
    The database implementation of the 'linkADRs' function, which inserts a relationship record into the 'adr_relations' table.
    export function linkADRs(from_id, to_id, relation) {
      db.prepare(
        'INSERT OR IGNORE INTO adr_relations (from_id, to_id, relation) VALUES (?, ?, ?)'
      ).run(from_id, to_id, relation);
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wooxogh/adr-mcp-setup'

If you have feedback or need assistance with the MCP directory API, please join our Discord server