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

Method formatFilesFlat

src/mcp/tools.ts:6583–6595  ·  view source on GitHub ↗

* Format files as a flat list

(files: { path: string; language: string; nodeCount: number }[], includeMetadata: boolean)

Source from the content-addressed store, hash-verified

6581 * Format files as a flat list
6582 */
6583 private formatFilesFlat(files: { path: string; language: string; nodeCount: number }[], includeMetadata: boolean): string {
6584 const lines: string[] = [`**Files (${files.length})**`, ''];
6585
6586 for (const file of files.sort((a, b) => a.path.localeCompare(b.path))) {
6587 if (includeMetadata) {
6588 lines.push(`- ${file.path} (${file.language}, ${file.nodeCount} symbols)`);
6589 } else {
6590 lines.push(`- ${file.path}`);
6591 }
6592 }
6593
6594 return lines.join('\n');
6595 }
6596
6597 /**
6598 * Format files grouped by language

Callers 1

handleFilesMethod · 0.95

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected