Skip to main content
Glama
formatResponse.ts513 B
export function formatResponse(response: any) { return { content: [{ type: "text" as "text", text: JSON.stringify(response) }], }; } // https://modelcontextprotocol.io/docs/concepts/tools#error-handling-2 export function formatErrorResponse(error: any) { return { isError: true, content: [ { type: "text" as "text", text: JSON.stringify({ name: error.name ?? "", message: error.message ?? "", error: error, }), }, ], }; }

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/webflow/mcp-server'

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