Skip to main content
Glama

MPC Tally API Server

getAddressGovernances.ts1.37 kB
import { GraphQLClient } from 'graphql-request'; import { gql } from 'graphql-request'; import { AddressGovernancesInput } from './addresses.types.js'; import { getAddress } from 'ethers'; const GET_ADDRESS_GOVERNANCES_QUERY = gql` query AddressGovernances($input: DelegatesInput!) { delegates(input: $input) { nodes { ... on Delegate { chainId votesCount organization { id name slug metadata { icon } delegatesVotesCount } token { id name symbol decimals supply } } } } } `; export async function getAddressGovernances( client: GraphQLClient, input: AddressGovernancesInput ): Promise<Record<string, any>> { try { const response = await client.request( GET_ADDRESS_GOVERNANCES_QUERY, { input: { filters: { address: getAddress(input.address) } } } ) as Record<string, any>; return response; } catch (error: any) { if (error.response?.status === 422) { return { delegates: { nodes: [] } }; } throw new Error(`Failed to fetch address governances: ${error instanceof Error ? error.message : 'Unknown error'}`); } }

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