Skip to main content
Glama

search_decisions

Search past architectural decisions by keyword to find relevant ADRs and avoid repeating previous solutions.

Instructions

Search past architectural decisions by keyword

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term (e.g. Redis, PostgreSQL, JWT)

Implementation Reference

  • db.js:138-145 (handler)
    The actual implementation of the 'search_decisions' logic, querying the SQLite database.
    export function searchDecisions(query) {
      return db.prepare(`
        SELECT s.id, s.project, s.summary, s.created_at, a.title, a.decision, a.status
        FROM sessions s LEFT JOIN adrs a ON a.session_id = s.id
        WHERE s.conversation LIKE ? OR s.summary LIKE ? OR a.decision LIKE ?
        ORDER BY s.created_at DESC LIMIT 10
      `).all(`%${query}%`, `%${query}%`, `%${query}%`);
    }
  • index.js:123-137 (registration)
    The registration of the 'search_decisions' tool in the MCP server, which wraps the 'searchDecisions' function.
    server.registerTool('search_decisions', {
      description: 'Search past architectural decisions by keyword',
      inputSchema: {
        query: z.string().describe('Search term (e.g. Redis, PostgreSQL, JWT)'),
      },
    }, async ({ query }) => {
      const results = searchDecisions(query);
      if (!results.length) return { content: [{ type: 'text', text: 'No results found' }] };
    
      const output = results.map(r =>
        `[${r.created_at}] ${r.project} — [${r.status ?? 'Accepted'}] ${r.title ?? 'untitled'}\n  Summary: ${r.summary ?? 'none'}\n  Decision: ${r.decision ?? 'none'}`
      ).join('\n\n');
    
      return { content: [{ type: 'text', text: output }] };
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool searches 'past architectural decisions by keyword' but doesn't reveal critical behaviors such as whether it's read-only, how results are returned (e.g., pagination, format), error conditions, or any rate limits. This leaves significant gaps for an agent to understand the tool's operation.

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 core functionality ('Search past architectural decisions by keyword'). There is no wasted text, making it highly concise and well-structured for quick understanding.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like safety (read vs. write), result format, or error handling. For a search tool with no structured metadata, more context is needed to guide an agent effectively, such as what the search returns or any limitations.

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 the 'query' parameter fully documented as a 'Search term (e.g. Redis, PostgreSQL, JWT)'. The description adds minimal value beyond this, only implying keyword-based search without providing additional syntax, format details, or constraints. This meets the baseline for high schema coverage.

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 with a specific verb ('search') and resource ('past architectural decisions'), and specifies the search mechanism ('by keyword'). However, it doesn't explicitly differentiate from sibling tools like 'check_stale_adrs' or 'get_adr_graph', which might also involve decision retrieval.

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. With siblings like 'check_stale_adrs' (likely for stale decisions) and 'get_adr_graph' (likely for relationships), there's no indication of when keyword search is preferred over other retrieval methods, nor any prerequisites or exclusions mentioned.

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