Skip to main content
Glama

MPC Tally API Server

tally.service.errors.test.ts1.48 kB
import { TallyService } from '../tally.service'; import dotenv from 'dotenv'; dotenv.config(); describe('TallyService - Error Handling', () => { let tallyService: TallyService; beforeEach(() => { tallyService = new TallyService({ apiKey: process.env.TALLY_API_KEY || 'test-api-key', }); }); describe('API Errors', () => { it('should handle invalid API key', async () => { const invalidService = new TallyService({ apiKey: 'invalid-key' }); try { await invalidService.listDAOs({ limit: 2, sortBy: 'popular' }); fail('Should have thrown an error'); } catch (error) { expect(error).toBeDefined(); expect(String(error)).toContain('Failed to fetch DAOs'); expect(String(error)).toContain('502'); } }, 60000); it('should handle rate limiting', async () => { const promises = Array(5).fill(null).map(() => tallyService.listDAOs({ limit: 1, sortBy: 'popular' }) ); try { await Promise.all(promises); // If we don't get rate limited, that's okay too } catch (error) { expect(error).toBeDefined(); const errorString = String(error); // Check for either 429 (rate limit) or other API errors expect( errorString.includes('429') || errorString.includes('Failed to fetch') ).toBe(true); } }, 60000); }); });

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/crazyrabbitLTC/mpc-tally-api-server'

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