link_commits_to_sessions
Connect git commits to writing sessions to track manuscript changes and provide context for project development.
Instructions
Link git commits to writing sessions for context
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "link_commits_to_sessions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | Path to manuscript directory (defaults to current directory) | |
| since | No | Start date (ISO format or relative) | |
| limit | No | Maximum commits to process |
Implementation Reference
- src/WritersAid.ts:724-739 (handler)Core handler implementation: indexes git commits since optional date and links them to writing sessions via GitIntegrator
async linkCommitsToSessions(options?: { since?: string; limit?: number }) { const since = options?.since ? new Date(options.since) : undefined; const result = await this.gitIntegrator.indexCommits({ since, filePattern: "**/*.md", }); // Auto-link commits to sessions based on timestamp proximity // (Future enhancement: use conversation files for precise linking) return { commitsIndexed: result.commitsIndexed, revisionsCreated: result.revisionsCreated, message: "Git commits indexed successfully", }; } - src/tools/WriterToolHandlers.ts:479-484 (handler)MCP tool handler wrapper: extracts 'since' and 'limit' parameters from args and delegates to WritersAid implementation
private async linkCommitsToSessions(args: Record<string, unknown>) { const since = args.since as string | undefined; const limit = (args.limit as number) || 20; return this.writersAid.linkCommitsToSessions({ since, limit }); } - src/tools/WriterToolHandlers.ts:88-89 (registration)Tool registration in the main handleTool switch statement
case "link_commits_to_sessions": return this.linkCommitsToSessions(args); - MCP tool schema definition including input parameters and description
{ name: "link_commits_to_sessions", description: "Link git commits to writing sessions for context", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" }, since: { type: "string", description: "Start date (ISO format or relative)" }, limit: { type: "number", description: "Maximum commits to process", default: 20 }, }, }, },