Skip to main content
Glama

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
NameRequiredDescriptionDefault
blockNumberNoThe block number
blockHashNoThe 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"] }],
      },
    },
  • TypeScript type definition for the input parameters of the tool
    type GetBlockWithTransactionsParams = {
      blockNumber?: string | number;
      blockHash?: string;
    };
  • Parameter validator function for the tool's input arguments
    const 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")
      );
    };

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/itsanishjain/alchemy-sdk-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server