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

Method formatSearchResults

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

Source from the content-addressed store, hash-verified

4806 // =========================================================================
4807
4808 private formatSearchResults(results: SearchResult[]): string {
4809 const lines: string[] = [`**Search Results (${results.length} found)**`, ''];
4810
4811 for (const result of results) {
4812 const { node } = result;
4813 const location = node.startLine ? `:${node.startLine}` : '';
4814 // Compact format: one line per result with key info
4815 lines.push(`**${node.name}** (${node.kind})`);
4816 lines.push(`${node.filePath}${location}`);
4817 if (node.signature) lines.push(`\`${node.signature}\``);
4818 lines.push('');
4819 }
4820
4821 return lines.join('\n');
4822 }
4823
4824 private formatNodeList(nodes: Node[], title: string, labels?: Map<string, string>): string {
4825 const lines: string[] = [`**${title} (${nodes.length} found)**`, ''];

Callers 1

handleSearchMethod · 0.95

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected