Skip to main content
Glama
index.spec.ts1.01 kB
describe('MCP Server Response Format', () => { describe('Response Format Tests', () => { it('should format error responses as text', () => { // arrange const error = new Error('API Error'); // act const response = { content: [ { type: 'text', text: `Error: ${error.message}`, }, ], }; // assert expect(response.content[0].type).toBe('text'); expect(response.content[0].text).toBe('Error: API Error'); }); it('should format unknown tool error as text', () => { // arrange const toolName = 'unknown_tool'; // act const response = { content: [ { type: 'text', text: `Error: Unknown tool: ${toolName}`, }, ], }; // assert expect(response.content[0].type).toBe('text'); expect(response.content[0].text).toBe( 'Error: Unknown tool: unknown_tool' ); }); }); });

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/bkotos/todoist-mcp'

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