Skip to main content
Glama
formatter.ts445 B
export type OutputFormat = 'json' | 'compact-json'; export function formatResponse(data: any, format?: OutputFormat): string { try { switch (format) { case 'compact-json': return JSON.stringify(data); case 'json': default: return JSON.stringify(data, null, 2); } } catch (error) { console.error('Formatting failed, falling back to JSON:', error); return JSON.stringify(data, null, 2); } }

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/vltansky/cursor-conversations-mcp'

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