block
Retrieve detailed blockchain block data including timestamp, transaction count, miner information, and size by specifying chain network and block number.
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
| Name | Required | Description | Default |
|---|---|---|---|
| chainName | Yes | The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet'). | |
| blockHeight | Yes | The block number to retrieve. Can be a specific block number or 'latest' for the most recent block. |
Implementation Reference
- src/services/BaseService.ts:97-115 (handler)The handler function for the 'block' tool, which calls goldRushClient.BaseService.getBlock.
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, }; - src/services/BaseService.ts:79-96 (registration)Registration of the 'block' tool with its schema definition using Zod.
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." ), },