check_stale_adrs
Identify Accepted ADRs that have not been reviewed recently and may require updates, using a configurable age threshold.
Instructions
Find Accepted ADRs that have not been reviewed in a while and may need revisiting
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| months | No | Age threshold in months (default: 6) |
Implementation Reference
- db.js:124-132 (handler)The logic to query stale ADRs from the database.
export function getStaleADRs(months = 6) { return db.prepare(` SELECT a.id, a.title, a.status, a.created_at, s.project FROM adrs a JOIN sessions s ON s.id = a.session_id WHERE a.status = 'Accepted' AND a.created_at <= datetime('now', '-' || ? || ' months') ORDER BY a.created_at ASC `).all(months); } - index.js:240-250 (registration)Registration of the check_stale_adrs tool and its handler implementation.
server.registerTool('check_stale_adrs', { description: 'Find Accepted ADRs that have not been reviewed in a while and may need revisiting', inputSchema: { months: z.number().optional().describe('Age threshold in months (default: 6)'), }, }, async ({ months = 6 }) => { const stale = getStaleADRs(months); if (!stale.length) { return { content: [{ type: 'text', text: `No ADRs older than ${months} months. Everything looks fresh.` }] }; }