get_block_with_transactions
Retrieve blockchain block data including all transaction details using either block number or hash with the Alchemy MCP Plugin.
Instructions
Get a block with its transactions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockNumber | No | The block number | |
| blockHash | No | The block hash |
Implementation Reference
- index.ts:856-873 (registration)Registration of the 'get_block_with_transactions' tool in the ListToolsRequestSchema handler, including the input schema definition{ name: "get_block_with_transactions", description: "Get a block with its transactions", inputSchema: { type: "object", properties: { blockNumber: { type: "string", description: "The block number", }, blockHash: { type: "string", description: "The block hash", }, }, oneOf: [{ required: ["blockNumber"] }, { required: ["blockHash"] }], }, },
- index.ts:85-88 (schema)TypeScript type definition for the input parameters of the tooltype GetBlockWithTransactionsParams = { blockNumber?: string | number; blockHash?: string; };
- index.ts:299-311 (helper)Parameter validator function for the tool's input argumentsconst isValidGetBlockWithTransactionsParams = ( args: any ): args is GetBlockWithTransactionsParams => { return ( typeof args === "object" && args !== null && (args.blockNumber !== undefined || args.blockHash !== undefined) && (args.blockNumber === undefined || typeof args.blockNumber === "string" || typeof args.blockNumber === "number") && (args.blockHash === undefined || typeof args.blockHash === "string") ); };