Skip to main content
Glama

generate_adr

Analyze a saved session to automatically generate an Architecture Decision Record (ADR) in markdown format, while checking for similar past decisions to prevent duplication.

Instructions

Analyze a saved session and auto-generate an ADR. Exports a markdown file and warns about similar past decisions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesSession ID

Implementation Reference

  • index.js:76-98 (handler)
    The handler function for the generate_adr tool. It processes a session, extracts ADR information (using AI or heuristic), checks for similarities, saves the ADR, and generates the output.
    }, async ({ session_id }) => {
      const session = getSession(session_id);
      if (!session) throw new Error(`Session ${session_id} not found`);
    
      const adr = process.env.ANTHROPIC_API_KEY
        ? await extractADRWithAI(session.conversation)
        : extractADR(session.conversation);
    
      const similar = findSimilarADRs(adr.title, adr.decision);
      const adrId = saveADR({ session_id, ...adr });
      const filepath = exportADRFile(adrId, adr, session_id);
    
      let output = adrMarkdown(adrId, adr, session_id) + `\n\n---\n_Exported to: ${filepath}_`;
    
      if (similar.length > 0) {
        const warn = similar
          .map(s => `  • ADR-${s.id} [${s.status}] "${s.title}" (${s.project}, ${s.created_at.slice(0, 10)})`)
          .join('\n');
        output += `\n\n⚠️  Similar past decisions found:\n${warn}`;
      }
    
      return { content: [{ type: 'text', text: output }] };
    });
  • index.js:71-75 (registration)
    Registration of the generate_adr tool, including its description and input schema.
    server.registerTool('generate_adr', {
      description: 'Analyze a saved session and auto-generate an ADR. Exports a markdown file and warns about similar past decisions.',
      inputSchema: {
        session_id: z.number().describe('Session ID'),
      },
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds some context: it 'exports a markdown file' (output format) and 'warns about similar past decisions' (a behavioral trait). However, it lacks details on permissions, rate limits, error handling, or whether the operation is read-only or destructive, which are critical for a tool that generates and exports files.

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

Conciseness4/5

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

The description is concise and front-loaded, stating the core action in the first clause. It uses two sentences efficiently to cover the main function and an additional feature ('warns about similar past decisions'). There's no wasted text, though it could be slightly more structured to separate usage from features.

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?

Given the tool's complexity (generating and exporting an ADR with warnings), lack of annotations, and no output schema, the description is moderately complete. It covers the basic action and a key feature but misses details on output format specifics, error cases, or integration with sibling tools. It's adequate as a minimum viable description but has clear gaps for full contextual understanding.

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?

The input schema has 100% description coverage, with 'session_id' documented as 'Session ID.' The description does not add any meaning beyond this, as it doesn't explain what a session ID entails or how it relates to ADR generation. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 tool's purpose: 'Analyze a saved session and auto-generate an ADR.' It specifies the verb ('analyze' and 'auto-generate') and resource ('saved session' to 'ADR'), making the action understandable. However, it doesn't explicitly differentiate from sibling tools like 'save_session' or 'review_adr', which might involve similar resources, so it misses full sibling distinction.

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 mentions 'warns about similar past decisions,' but this is a feature, not usage advice. There's no indication of prerequisites, when to choose this over tools like 'check_stale_adrs' or 'save_session', or any exclusions, leaving the agent with minimal context for selection.

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