Skip to main content
Glama
covalenthq

GoldRush MCP Server

by covalenthq

multichain_balances

Fetch token balances for a wallet address across multiple EVM chains in a single API call. Supports historical data, value conversion, and pagination to analyze holdings comprehensively.

Instructions

Fetch paginated spot & historical native and token balances for a single address on up to 10 EVM chains with one API call. Requires walletAddress. Optional parameters include chains array to specify networks, quoteCurrency for value conversion, limit (default 10), pagination (before), and cutoffTimestamp to filter by time. Use this to get a comprehensive view of token holdings across different blockchains.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletAddressYesThe wallet address to get token balances for. Must be a valid blockchain address.
quoteCurrencyNoCurrency to quote token values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency.
beforeNoPagination cursor to get balances before this point. Use the 'before' value from previous response.
limitNoMaximum number of token balances to return. Default is 10, maximum is 100.
chainsNoArray of blockchain networks to query balances from. Can be chain names or chain IDs. If not specified, queries all supported chains.
cutoffTimestampNoUnix timestamp to filter balances by last activity. Only returns tokens with activity after this time.

Implementation Reference

  • The handler function that executes the multichain_balances tool using the GoldRush client.
    async (params) => {
        try {
            const response =
                await goldRushClient.AllChainsService.getMultiChainBalances(
                    params.walletAddress,
                    {
                        quoteCurrency: params.quoteCurrency as Quote,
                        before: params.before,
                        limit: params.limit,
                        chains: params.chains as ChainID[] | ChainName[],
                        cutoffTimestamp: params.cutoffTimestamp,
                    }
                );
            return {
                content: [
                    {
                        type: "text",
                        text: stringifyWithBigInt(response.data),
                    },
                ],
            };
        } catch (error) {
            return {
                content: [{ type: "text", text: `Error: ${error}` }],
                isError: true,
            };
        }
    }
  • Zod schema definition for the input parameters of the multichain_balances tool.
    {
        walletAddress: z
            .string()
            .describe(
                "The wallet address to get token balances for. Must be a valid blockchain address."
            ),
        quoteCurrency: z
            .enum(Object.values(validQuoteValues) as [string, ...string[]])
            .optional()
            .describe(
                "Currency to quote token values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."
            ),
        before: z
            .string()
            .optional()
            .describe(
                "Pagination cursor to get balances before this point. Use the 'before' value from previous response."
            ),
        limit: z
            .number()
            .optional()
            .default(10)
            .describe(
                "Maximum number of token balances to return. Default is 10, maximum is 100."
            ),
        chains: z
            .array(
                z.union([
                    z.enum(
                        Object.values(ChainName) as [string, ...string[]]
                    ),
                    z.number(),
                ])
            )
            .optional()
            .describe(
                "Array of blockchain networks to query balances from. Can be chain names or chain IDs. If not specified, queries all supported chains."
            ),
        cutoffTimestamp: z
            .number()
            .optional()
            .describe(
                "Unix timestamp to filter balances by last activity. Only returns tokens with activity after this time."
            ),
    },
  • Registration of the multichain_balances tool within the MCP server instance.
    server.tool(
        "multichain_balances",
        "Fetch paginated spot & historical native and token balances for a single address on up to 10 EVM chains with one API call. " +
            "Requires walletAddress. Optional parameters include chains array to specify networks, " +
            "quoteCurrency for value conversion, limit (default 10), pagination (before), " +
            "and cutoffTimestamp to filter by time. " +
            "Use this to get a comprehensive view of token holdings across different blockchains.",

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/covalenthq/goldrush-mcp-server'

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