activity_log
Track project changes and review recent activity in Saga MCP's structured database to maintain continuity across sessions.
Instructions
View the activity log showing what changed and when. Useful for understanding recent progress or reviewing what happened since the last session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity_type | No | Filter by entity type | |
| entity_id | No | Filter by specific entity | |
| action | No | Filter by action type | |
| since | No | ISO 8601 datetime - show only activity after this time | |
| limit | No |
Implementation Reference
- src/tools/activity.ts:70-103 (handler)The handler function for the 'activity_log' tool which queries the activity_log table based on provided filters.
function handleActivityLog(args: Record<string, unknown>) { const db = getDb(); const entityType = args.entity_type as string | undefined; const entityId = args.entity_id as number | undefined; const action = args.action as string | undefined; const since = args.since as string | undefined; const limit = (args.limit as number) ?? 50; const whereClauses: string[] = []; const params: unknown[] = []; if (entityType) { whereClauses.push('entity_type = ?'); params.push(entityType); } if (entityId !== undefined) { whereClauses.push('entity_id = ?'); params.push(entityId); } if (action) { whereClauses.push('action = ?'); params.push(action); } if (since) { whereClauses.push('created_at > ?'); params.push(since); } const whereStr = whereClauses.length > 0 ? `WHERE ${whereClauses.join(' AND ')}` : ''; const sql = `SELECT * FROM activity_log ${whereStr} ORDER BY created_at DESC LIMIT ?`; params.push(limit); return db.prepare(sql).all(...params); } - src/tools/activity.ts:8-31 (schema)The definition and input schema for the 'activity_log' tool.
{ name: 'activity_log', description: 'View the activity log showing what changed and when. Useful for understanding recent progress or reviewing what happened since the last session.', annotations: { title: 'Activity Log', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, inputSchema: { type: 'object', properties: { entity_type: { type: 'string', enum: ['project', 'epic', 'task', 'subtask', 'note'], description: 'Filter by entity type', }, entity_id: { type: 'integer', description: 'Filter by specific entity' }, action: { type: 'string', enum: ['created', 'updated', 'deleted', 'status_changed'], description: 'Filter by action type', }, since: { type: 'string', description: 'ISO 8601 datetime - show only activity after this time' }, limit: { type: 'integer', default: 50 }, }, }, }, - src/tools/activity.ts:241-242 (registration)Registration of the 'activity_log' handler within the tools module.
export const handlers: Record<string, ToolHandler> = { activity_log: handleActivityLog,