history_search
Search collaboration history records in Claude Team MCP to find past interactions and discussions using keywords.
Instructions
搜索协作历史记录
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 搜索关键词 | |
| limit | No | 返回记录数量,默认 10 |
Implementation Reference
- src/server.ts:540-553 (handler)The main handler for the 'history_search' tool in the MCP server's CallToolRequestSchema request handler. Parses input arguments, invokes HistoryManager.search, and returns formatted results or no-results message.case 'history_search': { const { query, limit } = args as { query: string; limit?: number }; const results = historyManager.search(query, limit || 10); return { content: [ { type: 'text', text: results.length > 0 ? historyManager.formatList(results) : `未找到包含 "${query}" 的协作记录`, }, ], }; }
- src/server.ts:228-245 (registration)Tool registration in the ListToolsRequestSchema handler's tools array, defining name, description, and input schema for 'history_search'.{ name: 'history_search', description: '搜索协作历史记录', inputSchema: { type: 'object', properties: { query: { type: 'string', description: '搜索关键词', }, limit: { type: 'number', description: '返回记录数量,默认 10', }, }, required: ['query'], }, },
- src/collaboration/history.ts:202-213 (helper)The core search implementation in HistoryManager class. Retrieves up to 100 recent summaries, filters case-insensitively by query matching task or summary, and applies limit.search(query: string, limit = 10): HistorySummary[] { const allEntries = this.list(100); const lowerQuery = query.toLowerCase(); return allEntries .filter( (entry) => entry.task.toLowerCase().includes(lowerQuery) || entry.summary.toLowerCase().includes(lowerQuery) ) .slice(0, limit); }