MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / formatSearchResults

Method formatSearchResults

src/mcp/tools.ts:9018–9032  ·  view source on GitHub ↗
(results: SearchResult[])

Source from the content-addressed store, hash-verified

9016 // =========================================================================
9017
9018 private formatSearchResults(results: SearchResult[]): string {
9019 const lines: string[] = [`**Search Results (${results.length} found)**`, ''];
9020
9021 for (const result of results) {
9022 const { node } = result;
9023 const location = node.startLine ? `:${node.startLine}` : '';
9024 // Compact format: one line per result with key info
9025 lines.push(`**${node.name}** (${node.kind})`);
9026 lines.push(`${node.filePath}${location}`);
9027 if (node.signature) lines.push(`\`${node.signature}\``);
9028 lines.push('');
9029 }
9030
9031 return lines.join('\n');
9032 }
9033
9034 private formatNodeList(
9035 nodes: Node[],

Callers 1

handleSearchMethod · 0.95

Calls 2

pushMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected