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)Main handler function that processes the tool call, extracts limit parameter, fetches commit history via syncManager, formats and returns the response as JSON text.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:360-371 (registration)Tool registration in the MCP tools array, defining name, description, and input schema for limit parameter.name: 'get_commit_history', description: '최근 커밋 히스토리를 조회합니다', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: '조회할 커밋 수 (기본: 10)' } }, }, },
- src/sync-manager.ts:162-176 (helper)Helper method in SyncManager that calls GitHub API via githubClient to retrieve recent commits for the memory file and formats the commit data.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 []; } }
- src/index.ts:412-413 (handler)Dispatch case in the main request handler that routes 'get_commit_history' tool calls to the specific handler function.case 'get_commit_history': return await this.handleGetCommitHistory(args);