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

Method formatFilesFlat

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

4253 * Format files as a flat list
4254 */
4255 private formatFilesFlat(files: { path: string; language: string; nodeCount: number }[], includeMetadata: boolean): string {
4256 const lines: string[] = [`**Files (${files.length})**`, ''];
4257
4258 for (const file of files.sort((a, b) => a.path.localeCompare(b.path))) {
4259 if (includeMetadata) {
4260 lines.push(`- ${file.path} (${file.language}, ${file.nodeCount} symbols)`);
4261 } else {
4262 lines.push(`- ${file.path}`);
4263 }
4264 }
4265
4266 return lines.join('\n');
4267 }
4268
4269 /**
4270 * Format files grouped by language

Callers 1

handleFilesMethod · 0.95

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected