Skip to main content
Glama
covalenthq

GoldRush MCP Server

by covalenthq

block

Retrieve comprehensive chain data at a given height: includes timestamp, transaction count, size, and miner information. Provide chain name and height.

Instructions

Commonly used to fetch and render a single block for a block explorer.Requires chainName (blockchain network) and blockHeight (block number). Returns comprehensive block data including timestamp, transaction count, size, miner information, and other blockchain-specific details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNameYesThe blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet').
blockHeightYesThe block number to retrieve. Can be a specific block number or 'latest' for the most recent block.

Implementation Reference

  • The 'block' tool is registered via server.tool() with name 'block', description, Zod schema (chainName, blockHeight), and handler callback.
    server.tool(
        "block",
        "Commonly used to fetch and render a single block for a block explorer." +
            "Requires chainName (blockchain network) and blockHeight (block number). " +
            "Returns comprehensive block data including timestamp, transaction count, size, " +
            "miner information, and other blockchain-specific details.",
        {
            chainName: z
                .enum(Object.values(ChainName) as [string, ...string[]])
                .describe(
                    "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
                ),
            blockHeight: z
                .string()
                .describe(
                    "The block number to retrieve. Can be a specific block number or 'latest' for the most recent block."
                ),
        },
        async (params) => {
            try {
                const response = await goldRushClient.BaseService.getBlock(
                    params.chainName as Chain,
                    params.blockHeight
                );
                return {
                    content: [
                        {
                            type: "text",
                            text: stringifyWithBigInt(response.data),
                        },
                    ],
                };
            } catch (err) {
                return {
                    content: [{ type: "text", text: `Error: ${err}` }],
                    isError: true,
                };
            }
        }
  • The handler function for the 'block' tool. Calls goldRushClient.BaseService.getBlock(chainName, blockHeight) and returns the response data stringified with BigInt support.
    async (params) => {
        try {
            const response = await goldRushClient.BaseService.getBlock(
                params.chainName as Chain,
                params.blockHeight
            );
            return {
                content: [
                    {
                        type: "text",
                        text: stringifyWithBigInt(response.data),
                    },
                ],
            };
        } catch (err) {
            return {
                content: [{ type: "text", text: `Error: ${err}` }],
                isError: true,
            };
        }
    }
  • Zod input schema for the 'block' tool: chainName (enum of ChainName values) and blockHeight (string, can be specific block number or 'latest').
    {
        chainName: z
            .enum(Object.values(ChainName) as [string, ...string[]])
            .describe(
                "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
            ),
        blockHeight: z
            .string()
            .describe(
                "The block number to retrieve. Can be a specific block number or 'latest' for the most recent block."
            ),
    },
  • stringifyWithBigInt helper used by the block tool handler to safely serialize BigInt values in JSON responses.
    export function stringifyWithBigInt(value: any): string {
        return JSON.stringify(
            value,
            (_, val) => (typeof val === "bigint" ? val.toString() : val),
            2
        );
    }
  • src/server.ts:67-69 (registration)
    The 'block' tool is indirectly registered via addBaseServiceTools(server, goldRushClient) call on line 69.
    // Add service tools
    addAllChainsServiceTools(server, goldRushClient);
    addBaseServiceTools(server, goldRushClient);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses output fields (timestamp, transaction count, etc.) but omits behavioral traits such as error handling, rate limits, or authentication needs. Adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences, front-loaded with the main purpose and key parameters. No redundant or unnecessary content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple 2-parameter tool with no output schema, the description covers purpose, required inputs, and key output fields. Lacks error handling or edge cases, but overall sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the description's parameter info barely adds value beyond the schema. It mentions blockHeight can be 'latest', but that's already in schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (fetch and render), resource (single block), and context (block explorer). It distinguishes from siblings like 'transactions_for_block' and 'block_heights' by focusing on comprehensive block data retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for block data retrieval but lacks explicit guidance on when to use this tool vs alternatives like 'block_heights' or 'transactions_for_block'. No exclusion criteria or when-not-to-use advice is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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