Skip to main content
Glama
covalenthq

GoldRush MCP Server

by covalenthq

log_events_by_address

Get decoded event logs from a smart contract address on any supported blockchain. Filter by block range to analyze specific on-chain interactions. Required: chain name and contract address.

Instructions

Commonly used to get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions.Requires chainName (blockchain network) and contractAddress (the address emitting events). Optional parameters include block range (startingBlock, endingBlock) and pagination settings (pageSize default 10, pageNumber default 0). Returns decoded event logs for the specified contract, useful for monitoring specific smart contract activity and analyzing on-chain events.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNameYesThe blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet').
contractAddressYesThe smart contract address to get event logs from. Supports ENS, RNS, Lens Handle, and Unstoppable Domain resolution.
startingBlockNoStarting block number to begin search from. Use with endingBlock to define a range.
endingBlockNoEnding block number to search until. Use with startingBlock to define a range.
pageSizeNoNumber of log events to return per page. Default is 10, maximum is 100.
pageNumberNoPage number for pagination, starting from 0. Default is 0.

Implementation Reference

  • The MCP tool handler for log_events_by_address. It calls goldRushClient.BaseService.getLogEventsByAddressByPage() with chainName, contractAddress, optional startingBlock/endingBlock, pageSize (default 10), and pageNumber (default 0). Returns the response data serialized with stringifyWithBigInt, or an error message.
    server.tool(
        "log_events_by_address",
        "Commonly used to get all the event logs emitted from a particular contract address. " +
            "Useful for building dashboards that examine on-chain interactions." +
            "Requires chainName (blockchain network) and contractAddress (the address emitting events). " +
            "Optional parameters include block range (startingBlock, endingBlock) and pagination settings " +
            "(pageSize default 10, pageNumber default 0). " +
            "Returns decoded event logs for the specified contract, useful for monitoring specific " +
            "smart contract activity and analyzing on-chain events.",
        {
            chainName: z
                .enum(Object.values(ChainName) as [string, ...string[]])
                .describe(
                    "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
                ),
            contractAddress: z
                .string()
                .describe(
                    "The smart contract address to get event logs from. Supports ENS, RNS, Lens Handle, and Unstoppable Domain resolution."
                ),
            startingBlock: z
                .union([z.string(), z.number()])
                .optional()
                .describe(
                    "Starting block number to begin search from. Use with endingBlock to define a range."
                ),
            endingBlock: z
                .union([z.string(), z.number()])
                .optional()
                .describe(
                    "Ending block number to search until. Use with startingBlock to define a range."
                ),
            pageSize: z
                .number()
                .optional()
                .default(10)
                .describe(
                    "Number of log events to return per page. Default is 10, maximum is 100."
                ),
            pageNumber: z
                .number()
                .optional()
                .default(0)
                .describe(
                    "Page number for pagination, starting from 0. Default is 0."
                ),
        },
        async (params) => {
            try {
                const response =
                    await goldRushClient.BaseService.getLogEventsByAddressByPage(
                        params.chainName as Chain,
                        params.contractAddress,
                        {
                            startingBlock: params.startingBlock,
                            endingBlock: params.endingBlock,
                            pageSize: params.pageSize,
                            pageNumber: params.pageNumber,
                        }
                    );
                return {
                    content: [
                        {
                            type: "text",
                            text: stringifyWithBigInt(response.data),
                        },
                    ],
                };
            } catch (err) {
                return {
                    content: [{ type: "text", text: `Error: ${err}` }],
                    isError: true,
                };
            }
        }
    );
  • Zod schema for log_events_by_address inputs: chainName (enum of ChainName), contractAddress (string), optional startingBlock/endingBlock (string|number), optional pageSize (number, default 10), optional pageNumber (number, default 0).
    {
        chainName: z
            .enum(Object.values(ChainName) as [string, ...string[]])
            .describe(
                "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
            ),
        contractAddress: z
            .string()
            .describe(
                "The smart contract address to get event logs from. Supports ENS, RNS, Lens Handle, and Unstoppable Domain resolution."
            ),
        startingBlock: z
            .union([z.string(), z.number()])
            .optional()
            .describe(
                "Starting block number to begin search from. Use with endingBlock to define a range."
            ),
        endingBlock: z
            .union([z.string(), z.number()])
            .optional()
            .describe(
                "Ending block number to search until. Use with startingBlock to define a range."
            ),
        pageSize: z
            .number()
            .optional()
            .default(10)
            .describe(
                "Number of log events to return per page. Default is 10, maximum is 100."
            ),
        pageNumber: z
            .number()
            .optional()
            .default(0)
            .describe(
                "Page number for pagination, starting from 0. Default is 0."
            ),
    },
  • The tool is registered via server.tool() with the name 'log_events_by_address' inside the addBaseServiceTools function, which is called from src/server.ts at line 69.
    server.tool(
        "log_events_by_address",
        "Commonly used to get all the event logs emitted from a particular contract address. " +
            "Useful for building dashboards that examine on-chain interactions." +
            "Requires chainName (blockchain network) and contractAddress (the address emitting events). " +
            "Optional parameters include block range (startingBlock, endingBlock) and pagination settings " +
            "(pageSize default 10, pageNumber default 0). " +
            "Returns decoded event logs for the specified contract, useful for monitoring specific " +
            "smart contract activity and analyzing on-chain events.",
        {
            chainName: z
                .enum(Object.values(ChainName) as [string, ...string[]])
                .describe(
                    "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
                ),
            contractAddress: z
                .string()
                .describe(
                    "The smart contract address to get event logs from. Supports ENS, RNS, Lens Handle, and Unstoppable Domain resolution."
                ),
            startingBlock: z
                .union([z.string(), z.number()])
                .optional()
                .describe(
                    "Starting block number to begin search from. Use with endingBlock to define a range."
                ),
            endingBlock: z
                .union([z.string(), z.number()])
                .optional()
                .describe(
                    "Ending block number to search until. Use with startingBlock to define a range."
                ),
            pageSize: z
                .number()
                .optional()
                .default(10)
                .describe(
                    "Number of log events to return per page. Default is 10, maximum is 100."
                ),
            pageNumber: z
                .number()
                .optional()
                .default(0)
                .describe(
                    "Page number for pagination, starting from 0. Default is 0."
                ),
        },
        async (params) => {
            try {
                const response =
                    await goldRushClient.BaseService.getLogEventsByAddressByPage(
                        params.chainName as Chain,
                        params.contractAddress,
                        {
                            startingBlock: params.startingBlock,
                            endingBlock: params.endingBlock,
                            pageSize: params.pageSize,
                            pageNumber: params.pageNumber,
                        }
                    );
                return {
                    content: [
                        {
                            type: "text",
                            text: stringifyWithBigInt(response.data),
                        },
                    ],
                };
            } catch (err) {
                return {
                    content: [{ type: "text", text: `Error: ${err}` }],
                    isError: true,
                };
            }
        }
    );
  • Helper function that serializes data to JSON, converting BigInt values to strings to avoid serialization errors. Used to format the response data from log_events_by_address.
    export function stringifyWithBigInt(value: any): string {
        return JSON.stringify(
            value,
            (_, val) => (typeof val === "bigint" ? val.toString() : val),
            2
        );
    }
Behavior3/5

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

No annotations are provided, so the description carries the behavioral burden. It discloses that the tool returns decoded event logs and requires a contract address and chain, but lacks details on side effects, rate limits, or data freshness.

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

Conciseness3/5

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

The description is somewhat dense with two long sentences; it could be more structured (e.g., bullet points). It is not overly verbose, but lacks ideal conciseness.

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

Completeness3/5

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

The tool has 6 parameters, no output schema, and moderate complexity. The description covers the core purpose and parameters but omits details on pagination behavior or error handling.

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?

The input schema has 100% coverage, and the description restates key parameters. It adds value by mentioning ENS resolution for contractAddress but does not provide additional meaning beyond the schema.

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

Purpose4/5

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

The description clearly states the tool retrieves event logs from a specific contract address and is used for dashboards and monitoring. However, it does not explicitly differentiate from sibling tool 'log_events_by_topic'.

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 explains typical use cases and lists required and optional parameters, but does not specify when to avoid this tool or suggest alternatives.

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