Skip to main content
Glama
covalenthq

GoldRush MCP Server

by covalenthq

gas_prices

Get real-time gas price estimates for blockchain transactions to optimize costs and confirmation times. Specify network and transaction type (ERC20, native tokens, or Uniswap V3).

Instructions

Get real-time gas estimates for different transaction speeds on a specific network, enabling users to optimize transaction costs and confirmation times. Requires chainName (blockchain network) and eventType (erc20, nativetokens, or uniswapv3). Optional parameter quoteCurrency allows conversion to different currencies (USD, EUR, etc). Returns estimated gas prices for low, medium, and high priority transactions for the specified event type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNameYesThe blockchain network to get gas prices for (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet').
eventTypeYesType of transaction to estimate gas for: 'erc20' for token transfers, 'nativetokens' for native transfers, 'uniswapv3' for DEX swaps.
quoteCurrencyNoCurrency to quote gas costs in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency.

Implementation Reference

  • The handler function for the "gas_prices" tool, which executes the gas price estimate request using the goldRushClient.
    async (params) => {
        try {
            const response = await goldRushClient.BaseService.getGasPrices(
                params.chainName as Chain,
                params.eventType,
                {
                    quoteCurrency: params.quoteCurrency as Quote,
                }
            );
            return {
                content: [
                    {
                        type: "text",
                        text: stringifyWithBigInt(response.data),
                    },
                ],
            };
        } catch (err) {
            return {
                content: [{ type: "text", text: `Error: ${err}` }],
                isError: true,
            };
        }
    }
  • The Zod schema defining the input parameters for the "gas_prices" tool.
    {
        chainName: z
            .enum(Object.values(ChainName) as [string, ...string[]])
            .describe(
                "The blockchain network to get gas prices for (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
            ),
        eventType: z
            .enum(["erc20", "nativetokens", "uniswapv3"])
            .describe(
                "Type of transaction to estimate gas for: 'erc20' for token transfers, 'nativetokens' for native transfers, 'uniswapv3' for DEX swaps."
            ),
        quoteCurrency: z
            .enum(Object.values(validQuoteValues) as [string, ...string[]])
            .optional()
            .describe(
                "Currency to quote gas costs in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."
            ),
    },
  • Registration of the "gas_prices" tool using server.tool within addBaseServiceTools.
    server.tool(
        "gas_prices",
        "Get real-time gas estimates for different transaction speeds on a specific network, enabling users to optimize transaction costs and confirmation times. " +
            "Requires chainName (blockchain network) and eventType (erc20, nativetokens, or uniswapv3). " +
            "Optional parameter quoteCurrency allows conversion to different currencies (USD, EUR, etc). " +
            "Returns estimated gas prices for low, medium, and high priority transactions for the specified event type.",
        {
            chainName: z
                .enum(Object.values(ChainName) as [string, ...string[]])
                .describe(
                    "The blockchain network to get gas prices for (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
                ),
            eventType: z
                .enum(["erc20", "nativetokens", "uniswapv3"])
                .describe(
                    "Type of transaction to estimate gas for: 'erc20' for token transfers, 'nativetokens' for native transfers, 'uniswapv3' for DEX swaps."
                ),
            quoteCurrency: z
                .enum(Object.values(validQuoteValues) as [string, ...string[]])
                .optional()
                .describe(
                    "Currency to quote gas costs in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."
                ),
        },
        async (params) => {
            try {
                const response = await goldRushClient.BaseService.getGasPrices(
                    params.chainName as Chain,
                    params.eventType,
                    {
                        quoteCurrency: params.quoteCurrency as Quote,
                    }
                );
                return {
                    content: [
                        {
                            type: "text",
                            text: stringifyWithBigInt(response.data),
                        },
                    ],
                };
            } catch (err) {
                return {
                    content: [{ type: "text", text: `Error: ${err}` }],
                    isError: true,
                };
            }
        }
    );

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