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")
      );
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It states what the tool does ('Get a block with its transactions') but doesn't describe behavioral traits such as whether it's a read-only operation, potential rate limits, error conditions, or what 'with its transactions' entails (e.g., full details vs. summaries). This leaves significant gaps for an agent to understand how to invoke it effectively.

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

Conciseness5/5

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

The description is extremely concise—a single, clear sentence that front-loads the core functionality without any wasted words. It efficiently communicates the tool's purpose in a minimal format, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the complexity of fetching blockchain data with transactions, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'with its transactions' means in terms of output (e.g., transaction objects, hashes, or details), nor does it cover error handling or behavioral aspects. This leaves the agent with insufficient context for reliable use.

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% description coverage, with clear documentation for 'blockNumber' and 'blockHash', and the 'oneOf' constraint is structurally defined. The description adds no parameter-specific semantics beyond implying that either parameter can be used to fetch the block, which is already evident from the schema. This meets the baseline for high schema coverage but doesn't enhance understanding.

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 verb ('Get') and resource ('a block with its transactions'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_block_number' (which likely returns just the number) or 'get_transaction' (which focuses on individual transactions), missing an opportunity for precise distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't clarify if this should be used instead of 'get_block_number' when transaction details are needed, or how it relates to 'get_transaction' for individual transaction data. There's no mention of prerequisites, exclusions, or contextual usage.

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

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