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

Method formatSearchResults

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

Source from the content-addressed store, hash-verified

9163 // =========================================================================
9164
9165 private formatSearchResults(results: SearchResult[]): string {
9166 const lines: string[] = [`**Search Results (${results.length} found)**`, ''];
9167
9168 for (const result of results) {
9169 const { node } = result;
9170 const location = node.startLine ? `:${node.startLine}` : '';
9171 // Compact format: one line per result with key info
9172 lines.push(`**${node.name}** (${node.kind})`);
9173 lines.push(`${node.filePath}${location}`);
9174 if (node.signature) lines.push(`\`${node.signature}\``);
9175 lines.push('');
9176 }
9177
9178 return lines.join('\n');
9179 }
9180
9181 private formatNodeList(
9182 nodes: Node[],

Callers 1

handleSearchMethod · 0.95

Calls 2

pushMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected