log_events_by_address
Retrieve decoded event logs from a smart contract address to monitor on-chain activity, analyze interactions, and build dashboards. Supports multiple blockchains and optional block range filtering.
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
| Name | Required | Description | Default |
|---|---|---|---|
| chainName | Yes | The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet'). | |
| contractAddress | Yes | The smart contract address to get event logs from. Supports ENS, RNS, Lens Handle, and Unstoppable Domain resolution. | |
| startingBlock | No | Starting block number to begin search from. Use with endingBlock to define a range. | |
| endingBlock | No | Ending block number to search until. Use with startingBlock to define a range. | |
| pageSize | No | Number of log events to return per page. Default is 10, maximum is 100. | |
| pageNumber | No | Page number for pagination, starting from 0. Default is 0. |
Implementation Reference
- src/services/BaseService.ts:187-262 (handler)Registration and implementation of the "log_events_by_address" MCP tool. The handler calls `goldRushClient.BaseService.getLogEventsByAddressByPage`.
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, }; } } );