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);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'Create a relationship,' implying a write/mutation operation, but doesn't specify permissions needed, whether the operation is idempotent, error handling (e.g., if ADRs don't exist), or side effects. This leaves significant gaps for a tool that modifies data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the purpose ('Create a relationship between two ADRs') and includes essential details (relationship types). There is no wasted language, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 3 parameters, 100% schema coverage, no annotations, and no output schema, the description is minimally adequate. It covers the basic action but lacks details on behavioral aspects like permissions, idempotency, or error cases. Without annotations or output schema, more context would be helpful for safe usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear parameter descriptions in the schema (e.g., 'Source ADR ID,' 'Target ADR ID,' 'Relationship type'). The description adds minimal value beyond the schema by listing the enum values for 'relation,' but doesn't explain the semantics of relationship types (e.g., what 'conflicts_with' means). Baseline 3 is appropriate as the schema does most of the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a relationship') and the resource ('between two ADRs'), with specific relationship types listed. It distinguishes itself from siblings like 'check_stale_adrs' or 'update_adr_status' by focusing on linking ADRs rather than status management or review. However, it doesn't explicitly differentiate from potential similar tools like 'get_adr_graph' which might retrieve relationships.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., ADRs must exist), exclusions, or compare to siblings like 'get_adr_graph' for viewing relationships or 'update_adr_status' for status changes. Usage is implied but not explicitly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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