Skip to main content
Glama

wait-for-transaction-receipt

Waits for blockchain transaction confirmation and returns the receipt after specified confirmations, enabling reliable transaction status verification.

Instructions

Waits for the transaction to be included on a block, and then returns the transaction receipt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesThe transaction hash to wait for.
confirmationsNoThe number of confirmations (blocks that have passed) to wait before resolving.
chainIdNoID of chain to use when fetching data.

Implementation Reference

  • The execute handler for the 'wait-for-transaction-receipt' tool. It awaits wagmi's waitForTransactionReceipt with the config and args, then returns the JSON-stringified result in MCP content format or the error message on failure.
    execute: async (args) => {
      try {
        const result = await waitForTransactionReceipt(wagmiConfig, args);
        return {
          content: [
            {
              type: "text",
              text: JSONStringify(result),
            },
          ],
        };
      }
      catch (error) {
        return {
          content: [
            {
              type: "text",
              text: (error as Error).message,
            },
          ],
        };
      }
    },
  • Zod schema for the tool's input parameters: hash (TransactionHash), optional confirmations (default 0), optional chainId.
    parameters: z.object({
      hash: TransactionHash.describe("The transaction hash to wait for."),
      confirmations: z.coerce.number().optional().default(0).describe("The number of confirmations (blocks that have passed) to wait before resolving."),
      chainId: z.coerce.number().optional().describe("ID of chain to use when fetching data."),
    }),
  • The tool registration function exported from the file, which calls server.addTool to register the tool with name, description, schema, and handler.
    export function registerWaitForTransactionReceiptTools(server: FastMCP, wagmiConfig: Config): void {
      server.addTool({
        name: "wait-for-transaction-receipt",
        description: "Waits for the transaction to be included on a block, and then returns the transaction receipt.",
        parameters: z.object({
          hash: TransactionHash.describe("The transaction hash to wait for."),
          confirmations: z.coerce.number().optional().default(0).describe("The number of confirmations (blocks that have passed) to wait before resolving."),
          chainId: z.coerce.number().optional().describe("ID of chain to use when fetching data."),
        }),
        execute: async (args) => {
          try {
            const result = await waitForTransactionReceipt(wagmiConfig, args);
            return {
              content: [
                {
                  type: "text",
                  text: JSONStringify(result),
                },
              ],
            };
          }
          catch (error) {
            return {
              content: [
                {
                  type: "text",
                  text: (error as Error).message,
                },
              ],
            };
          }
        },
      });
    };
  • Invocation of the tool's registration function within the central registerTools function that sets up all tools on the server.
    registerWaitForTransactionReceiptTools(server, wagmiConfig);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions waiting for inclusion and confirmations, but lacks details on timeouts, error handling, polling behavior, or what happens if the transaction fails. For a tool that involves waiting and potentially blocking operations, this is a significant gap in transparency.

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 a single, efficient sentence that front-loads the core functionality. Every word earns its place: 'Waits for the transaction to be included on a block' sets the action, and 'returns the transaction receipt' specifies the outcome. No waste or redundancy.

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 waiting for blockchain transactions, no annotations, and no output schema, the description is incomplete. It doesn't explain the return value (transaction receipt structure), error conditions, or behavioral nuances like polling intervals. For a tool with 3 parameters and significant operational implications, more context is needed.

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?

Schema description coverage is 100%, so the schema already documents all parameters (hash, confirmations, chainId). The description adds no additional meaning beyond what's in the schema, such as explaining the relationship between confirmations and block inclusion or default behaviors. Baseline 3 is appropriate when the schema does the heavy lifting.

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 tool's purpose: 'Waits for the transaction to be included on a block, and then returns the transaction receipt.' It specifies the verb ('waits for'), resource ('transaction'), and outcome ('returns the transaction receipt'). However, it doesn't explicitly differentiate from sibling tools like 'get-transaction-receipt' or 'wait-seconds', which would require a 5.

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. It doesn't mention sibling tools like 'get-transaction-receipt' (which might fetch a receipt without waiting) or 'wait-seconds' (which waits for time rather than transaction confirmation), nor does it specify prerequisites or exclusions. Usage is implied but not explicitly stated.

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/Xiawpohr/metamask-mcp'

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