get_timeline
Retrieve the decision timeline for a project to track architectural decisions and their evolution over time.
Instructions
Get the decision timeline for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | Project name (omit for all projects) |
Implementation Reference
- index.js:139-155 (handler)Tool registration and handler implementation for 'get_timeline' in index.js.
server.registerTool('get_timeline', { description: 'Get the decision timeline for a project', inputSchema: { project: z.string().optional().describe('Project name (omit for all projects)'), }, }, async ({ project }) => { const timeline = getTimeline(project); if (!timeline.length) return { content: [{ type: 'text', text: 'No records found' }] }; const output = timeline.map(t => { const commit = t.git_commit ? ` (${t.git_commit.slice(0, 7)})` : ''; const adr = t.adr_id ? ` → ADR-${t.adr_id} [${t.status}] "${t.adr_title}"` : ''; return `[${t.created_at}] ${t.project}${commit}${adr}\n ${t.summary ?? 'no summary'}`; }).join('\n'); return { content: [{ type: 'text', text: output }] }; }); - db.js:147-157 (handler)Database function implementation for 'getTimeline' that fetches the timeline records from the database.
export function getTimeline(project) { const where = project ? 'WHERE s.project = ?' : ''; const params = project ? [project] : []; return db.prepare(` SELECT s.id, s.project, s.summary, s.git_commit, s.created_at, a.id as adr_id, a.title as adr_title, a.status FROM sessions s LEFT JOIN adrs a ON a.session_id = s.id ${where} ORDER BY s.created_at ASC `).all(...params); }