MCPcopy Create free account
hub / github.com/codeaashu/claude-code / getSearchSummary

Function getSearchSummary

src/tools/WebSearchTool/UI.tsx:8–24  ·  view source on GitHub ↗
(results: (SearchResult | string | null | undefined)[])

Source from the content-addressed store, hash-verified

6import { truncate } from '../../utils/format.js';
7import type { Output, SearchResult, WebSearchProgress } from './WebSearchTool.js';
8function getSearchSummary(results: (SearchResult | string | null | undefined)[]): {
9 searchCount: number;
10 totalResultCount: number;
11} {
12 let searchCount = 0;
13 let totalResultCount = 0;
14 for (const result of results) {
15 if (result != null && typeof result !== 'string') {
16 searchCount++;
17 totalResultCount += result.content?.length ?? 0;
18 }
19 }
20 return {
21 searchCount,
22 totalResultCount
23 };
24}
25export function renderToolUseMessage({
26 query,
27 allowed_domains,

Callers 1

renderToolResultMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected