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

Method formatFilesFlat

src/mcp/tools.ts:4126–4138  ·  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

4124 * Format files as a flat list
4125 */
4126 private formatFilesFlat(files: { path: string; language: string; nodeCount: number }[], includeMetadata: boolean): string {
4127 const lines: string[] = [`**Files (${files.length})**`, ''];
4128
4129 for (const file of files.sort((a, b) => a.path.localeCompare(b.path))) {
4130 if (includeMetadata) {
4131 lines.push(`- ${file.path} (${file.language}, ${file.nodeCount} symbols)`);
4132 } else {
4133 lines.push(`- ${file.path}`);
4134 }
4135 }
4136
4137 return lines.join('\n');
4138 }
4139
4140 /**
4141 * Format files grouped by language

Callers 1

handleFilesMethod · 0.95

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected