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

Method formatSearchResults

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

Source from the content-addressed store, hash-verified

4569 // =========================================================================
4570
4571 private formatSearchResults(results: SearchResult[]): string {
4572 const lines: string[] = [`**Search Results (${results.length} found)**`, ''];
4573
4574 for (const result of results) {
4575 const { node } = result;
4576 const location = node.startLine ? `:${node.startLine}` : '';
4577 // Compact format: one line per result with key info
4578 lines.push(`**${node.name}** (${node.kind})`);
4579 lines.push(`${node.filePath}${location}`);
4580 if (node.signature) lines.push(`\`${node.signature}\``);
4581 lines.push('');
4582 }
4583
4584 return lines.join('\n');
4585 }
4586
4587 private formatNodeList(nodes: Node[], title: string, labels?: Map<string, string>): string {
4588 const lines: string[] = [`**${title} (${nodes.length} found)**`, ''];

Callers 1

handleSearchMethod · 0.95

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected