MCPcopy
hub / github.com/colbymchenry/codegraph / formatNodeList

Method formatNodeList

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

Source from the content-addressed store, hash-verified

4436 }
4437
4438 private formatNodeList(nodes: Node[], title: string, labels?: Map<string, string>): string {
4439 const lines: string[] = [`**${title} (${nodes.length} found)**`, ''];
4440
4441 for (const node of nodes) {
4442 const location = node.startLine ? `:${node.startLine}` : '';
4443 // Compact: just name, kind, location — plus the relationship when it
4444 // isn't a plain call (callback registration, instantiation, …).
4445 const label = labels?.get(node.id);
4446 lines.push(
4447 `- ${node.name} (${node.kind}) - ${node.filePath}${location}${label ? ` — via ${label}` : ''}`
4448 );
4449 }
4450
4451 return lines.join('\n');
4452 }
4453
4454 /**
4455 * Relationship label for a non-`calls` edge in callers/callees lists. A

Callers 2

handleCallersMethod · 0.95
handleCalleesMethod · 0.95

Calls 2

joinMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected