Skip to main content
Glama
server.test.js1.35 kB
/** * Integration tests for the server */ const request = require('supertest'); const app = require('../../src/server'); describe('Server integration tests', () => { describe('Health endpoint', () => { it('should return a 200 status and ok message', async () => { const response = await request(app).get('/health'); expect(response.status).toBe(200); expect(response.body).toHaveProperty('status', 'ok'); }); }); describe('MCP endpoint', () => { it('should handle invalid requests properly', async () => { const response = await request(app) .post('/') .send({}); expect(response.status).toBe(500); expect(response.body).toHaveProperty('error'); }); it('should validate function name', async () => { const response = await request(app) .post('/') .send({ parameters: {} }); expect(response.status).toBe(500); expect(response.body.error).toMatch(/function.*required/i); }); it('should reject invalid function names', async () => { const response = await request(app) .post('/') .send({ function: 'invalid_function', parameters: {} }); expect(response.status).toBe(500); expect(response.body.error).toMatch(/unsupported function/i); }); }); });

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/mattweg/ynab-mcp'

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