analyze_commits
Analyze GitHub repository commits to extract statistics and organize them by type for generating comprehensive release notes.
Instructions
Analyze commits and provide statistics
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | ||
| repo | Yes | ||
| timeRange | No | ||
| commitRange | No |
Implementation Reference
- src/release-notes-server/index.ts:91-116 (handler)The handler function for the 'analyze_commits' tool. Parses arguments, fetches commits from GitHub using fetchCommits, enriches with PR data, generates JSON analysis with stats using generateReleaseNotes, and returns the result.case 'analyze_commits': { const args = AnalyzeCommitsSchema.parse(request.params.arguments); // Fetch commits const commits = await fetchCommits( args.owner, args.repo, args.timeRange?.from, args.timeRange?.to, args.commitRange?.fromCommit, args.commitRange?.toCommit ); // Enrich commits with PR data const enrichedCommits = await enrichCommitsWithPRData(args.owner, args.repo, commits); // Generate analysis with stats const analysis = generateReleaseNotes(enrichedCommits, { format: 'json', includeStats: true, }); return { content: [{ type: 'text', text: analysis }], }; }
- Zod input schema for analyze_commits tool, defining required owner/repo and optional timeRange/commitRange.export const AnalyzeCommitsSchema = z.object({ owner: z.string(), repo: z.string(), timeRange: TimeRangeSchema.optional(), commitRange: CommitRangeSchema.optional() });
- src/release-notes-server/index.ts:42-46 (registration)Registration of the analyze_commits tool in the server's listTools response, specifying name, description, and converted input schema.{ name: 'analyze_commits', description: 'Analyze commits and provide statistics', inputSchema: zodToJsonSchema(AnalyzeCommitsSchema), },