kb_get_history
Retrieve recent knowledge base change history to track updates and maintain context across sessions.
Instructions
Get recent history of knowledge base changes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of history entries to return |
Implementation Reference
- src/index.ts:818-829 (handler)The main handler for the 'kb_get_history' tool. It extracts the optional 'limit' parameter (default 20), calls KnowledgeManager.getHistory(limit), and returns the history entries as a JSON-formatted text response.case 'kb_get_history': { const limit = (args as any).limit || 20; const history = km.getHistory(limit); return { content: [ { type: 'text', text: JSON.stringify(history, null, 2) } ] }; }
- src/index.ts:289-300 (schema)Tool schema definition including name, description, and input schema with optional 'limit' parameter (default: 20). This is part of the tools array used for tool listing.name: 'kb_get_history', description: 'Get recent history of knowledge base changes', inputSchema: { type: 'object', properties: { limit: { type: 'number', default: 20, description: 'Number of history entries to return' } } }
- src/index.ts:423-425 (registration)Registration of all tools (including kb_get_history) via the ListToolsRequestHandler, which returns the complete 'tools' array containing the kb_get_history definition.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/KnowledgeManager.ts:355-357 (helper)Helper method in KnowledgeManager that retrieves the most recent 'limit' history entries from the internal knowledge base history array.getHistory(limit: number = 20): HistoryEntry[] { return this.kb.history.slice(-limit); }