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

Method formatFilesFlat

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

4490 * Format files as a flat list
4491 */
4492 private formatFilesFlat(files: { path: string; language: string; nodeCount: number }[], includeMetadata: boolean): string {
4493 const lines: string[] = [`**Files (${files.length})**`, ''];
4494
4495 for (const file of files.sort((a, b) => a.path.localeCompare(b.path))) {
4496 if (includeMetadata) {
4497 lines.push(`- ${file.path} (${file.language}, ${file.nodeCount} symbols)`);
4498 } else {
4499 lines.push(`- ${file.path}`);
4500 }
4501 }
4502
4503 return lines.join('\n');
4504 }
4505
4506 /**
4507 * Format files grouped by language

Callers 1

handleFilesMethod · 0.95

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected