MCPcopy Create free account
hub / github.com/Waishnav/devspace / getToolLabel

Function getToolLabel

src/ui/workspace-app.tsx:531–546  ·  view source on GitHub ↗
(card: ToolResultCard)

Source from the content-addressed store, hash-verified

529}
530
531function getToolLabel(card: ToolResultCard): string {
532 if (isShellTool(card.tool)) {
533 return String(card.summary?.command ?? card.summary?.sessionId ?? card.path ?? card.tool);
534 }
535 if (isReviewTool(card.tool)) {
536 const count = Number(card.summary?.files ?? card.files?.length ?? 0);
537 return count === 0 ? "No changes since last review" : `${count} changed ${count === 1 ? "file" : "files"}`;
538 }
539 if (card.path) return card.path;
540 if (card.root) return card.root;
541 if (isSearchTool(card.tool)) {
542 return String(card.summary?.pattern ?? card.tool);
543 }
544
545 return card.tool;
546}
547
548function toolNameFromMeta(result: CallToolResult): ToolName | undefined {
549 const meta = result._meta as Record<string, unknown> | undefined;

Callers 1

getToolDisplayFunction · 0.85

Calls 3

isShellToolFunction · 0.85
isReviewToolFunction · 0.85
isSearchToolFunction · 0.85

Tested by

no test coverage detected