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

Method cacheToolResult

src/context/storage/CacheStore.ts:146–150  ·  view source on GitHub ↗

* 缓存工具调用结果

(toolName: string, input: any, result: any)

Source from the content-addressed store, hash-verified

144 * 缓存工具调用结果
145 */
146 cacheToolResult(toolName: string, input: any, result: any): void {
147 const inputHash = this.hashInput(input);
148 const key = `tool:${toolName}:${inputHash}`;
149 this.set(key, result, 30 * 60 * 1000); // 30分钟TTL
150 }
151
152 /**
153 * 获取缓存的工具调用结果

Callers 1

addToolCallMethod · 0.80

Calls 2

hashInputMethod · 0.95
setMethod · 0.95

Tested by

no test coverage detected