Skip to main content
Glama
file.ts666 B
import { readFileSync, existsSync } from 'fs' import { resolve } from 'path' export function processFiles(files: string[]) { const resolvedFiles = files.map((f) => resolve(f)) const missingFiles = resolvedFiles.filter((f) => !existsSync(f)) if (missingFiles.length > 0) { throw new Error(`Files not found: ${missingFiles.join(', ')}`) } const contextFiles: { path: string; content: string }[] = [] for (let i = 0; i < files.length; i++) { const filePath = resolvedFiles[i] const originalPath = files[i] const content = readFileSync(filePath, 'utf-8') contextFiles.push({ path: originalPath, content }) } return contextFiles }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/raine/consult-llm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server