Skip to main content
Glama

MPC Tally API Server

tally.service.proposal-votes-cast-list.test.ts968 B
import { GraphQLClient } from 'graphql-request'; import { getProposalVotesCastList } from '../proposals/getProposalVotesCastList.js'; import { TallyAPIError } from '../errors/apiErrors.js'; const VALID_PROPOSAL_ID = '2502358713906497413'; const apiKey = process.env.TALLY_API_KEY; const client = new GraphQLClient('https://api.tally.xyz/query', { headers: { 'Api-Key': apiKey || '', }, }); describe('getProposalVotesCastList', () => { it('should fetch and format votes correctly', async () => { const result = await getProposalVotesCastList(client, { id: VALID_PROPOSAL_ID }); expect(result).toBeDefined(); expect(result.forVotes).toBeDefined(); expect(result.forVotes.nodes).toBeDefined(); expect(result.forVotes.nodes.length).toBeGreaterThan(0); }); it('should throw error for invalid proposal ID', async () => { await expect(getProposalVotesCastList(client, { id: 'invalid-id' })).rejects.toThrow(TallyAPIError); }); });

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