Skip to main content
Glama
prompt-builder.ts634 B
export function buildPrompt( userPrompt: string, files: Array<{ path: string; content: string }>, gitDiffOutput?: string, ): string { const promptParts: string[] = [] if (gitDiffOutput?.trim()) { promptParts.push('## Git Diff\n```diff', gitDiffOutput, '```\n') } if (files.length > 0) { promptParts.push('## Relevant Files\n') for (const file of files) { promptParts.push(`### File: ${file.path}`) promptParts.push('```') promptParts.push(file.content) promptParts.push('```\n') } } // Add user prompt last promptParts.push(userPrompt) return promptParts.join('\n') }

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