get_commit_history
Retrieve recent commit history from GitHub repositories to track changes and maintain version control for remote memory data synchronization.
Instructions
최근 커밋 히스토리를 조회합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 조회할 커밋 수 (기본: 10) |
Implementation Reference
- src/index.ts:760-786 (handler)The primary handler function for the 'get_commit_history' tool. It parses the 'limit' argument, calls SyncManager.getCommitHistory, and returns a formatted JSON response with commits or error.private async handleGetCommitHistory(args: any) { try { const limit = args.limit || 10; const commits = await this.syncManager.getCommitHistory(limit); return { content: [{ type: 'text', text: JSON.stringify({ success: true, commits, count: commits.length }, null, 2), }], }; } catch (error) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : 'Unknown error' }, null, 2), }], }; } }
- src/index.ts:359-371 (registration)Registration of the 'get_commit_history' tool in the ListTools response, including name, description, and input schema definition.{ name: 'get_commit_history', description: '최근 커밋 히스토리를 조회합니다', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: '조회할 커밋 수 (기본: 10)' } }, }, },
- src/index.ts:362-370 (schema)Input schema definition for the 'get_commit_history' tool, specifying an optional 'limit' parameter of type number.inputSchema: { type: 'object', properties: { limit: { type: 'number', description: '조회할 커밋 수 (기본: 10)' } }, },
- src/sync-manager.ts:162-176 (helper)Helper method in SyncManager that fetches commit history from GitHub for the memory file path, maps the response to a simplified format, and handles errors.async getCommitHistory(limit: number = 10): Promise<any[]> { try { const response = await this.githubClient.getCommits(this.MEMORY_FILE_PATH, limit); return response.map(commit => ({ sha: commit.sha.substring(0, 7), message: commit.commit.message, author: commit.commit.author.name, date: commit.commit.author.date, url: commit.html_url })); } catch (error) { console.error('Failed to get commit history:', error); return []; } }