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

Method formatNodeList

src/mcp/tools.ts:4587–4601  ·  view source on GitHub ↗
(nodes: Node[], title: string, labels?: Map<string, string>)

Source from the content-addressed store, hash-verified

4585 }
4586
4587 private formatNodeList(nodes: Node[], title: string, labels?: Map<string, string>): string {
4588 const lines: string[] = [`**${title} (${nodes.length} found)**`, ''];
4589
4590 for (const node of nodes) {
4591 const location = node.startLine ? `:${node.startLine}` : '';
4592 // Compact: just name, kind, location — plus the relationship when it
4593 // isn't a plain call (callback registration, instantiation, …).
4594 const label = labels?.get(node.id);
4595 lines.push(
4596 `- ${node.name} (${node.kind}) - ${node.filePath}${location}${label ? ` — via ${label}` : ''}`
4597 );
4598 }
4599
4600 return lines.join('\n');
4601 }
4602
4603 /**
4604 * Relationship label for a non-`calls` edge in callers/callees lists. A

Callers 2

handleCallersMethod · 0.95
handleCalleesMethod · 0.95

Calls 2

getMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected