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

Function displayToolResult

src/commands/tools.ts:367–390  ·  view source on GitHub ↗

* 显示工具执行结果

(response: any)

Source from the content-addressed store, hash-verified

365 * 显示工具执行结果
366 */
367function displayToolResult(response: any): void {
368 if (response.success) {
369 UIDisplay.success('工具执行成功');
370
371 if (response.data) {
372 UIDisplay.section('执行结果');
373 if (typeof response.data === 'string') {
374 UIDisplay.text(response.data);
375 } else {
376 console.log(JSON.stringify(response.data, null, 2));
377 }
378 }
379
380 if (response.metadata) {
381 UIDisplay.section('元数据');
382 console.log(JSON.stringify(response.metadata, null, 2));
383 }
384 } else {
385 UIDisplay.error('工具执行失败');
386 if (response.error) {
387 UIDisplay.text(`错误信息: ${response.error}`);
388 }
389 }
390}
391
392/**
393 * 生成工具文档

Callers 1

toolsCommandFunction · 0.85

Calls 5

successMethod · 0.80
sectionMethod · 0.80
textMethod · 0.45
logMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected