MCPcopy Create free account
hub / github.com/echoVic/blade-code / addToolCall

Method addToolCall

src/context/storage/MemoryStore.ts:67–82  ·  view source on GitHub ↗

* 添加工具调用记录

(toolCall: ToolCall)

Source from the content-addressed store, hash-verified

65 * 添加工具调用记录
66 */
67 addToolCall(toolCall: ToolCall): void {
68 if (!this.contextData) {
69 throw new Error('上下文数据未初始化');
70 }
71
72 this.contextData.layers.tool.recentCalls.push(toolCall);
73 this.contextData.metadata.lastUpdated = Date.now();
74
75 // 保持工具调用历史在合理范围内
76 if (this.contextData.layers.tool.recentCalls.length > 50) {
77 this.contextData.layers.tool.recentCalls =
78 this.contextData.layers.tool.recentCalls.slice(-25);
79 }
80
81 this.recordAccess('tools');
82 }
83
84 /**
85 * 更新工具状态

Callers

nothing calls this directly

Calls 1

recordAccessMethod · 0.95

Tested by

no test coverage detected