Skip to main content
Glama

wait-for-transaction-receipt

Waits for blockchain transaction confirmation and returns the receipt after inclusion in a block.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYes
chainIdNo

Implementation Reference

  • The handler function that executes the tool logic: waits for the transaction receipt using wagmi/core's waitForTransactionReceipt, stringifies the result or error message and returns as MCP content.
    execute: async (args) => {
      try {
        const hash = args.hash as Address
        const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
        const result = await waitForTransactionReceipt(wagmiConfig, {
          hash,
          chainId,
        })
        return {
          content: [
            {
              type: "text",
              text: JSONStringify(result),
            },
          ],
        }
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: (error as Error).message,
            },
          ],
        }
      }
    },
  • Zod input schema defining required 'hash' (string) and optional 'chainId' (number).
    parameters: z.object({
      hash: z.string(),
      chainId: z.coerce.number().optional(),
    }),
  • The registration function that defines and adds the tool to the FastMCP server instance.
    export function registerWaitForTransactionReceiptTools(server: FastMCP): 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: z.string(),
          chainId: z.coerce.number().optional(),
        }),
        execute: async (args) => {
          try {
            const hash = args.hash as Address
            const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
            const result = await waitForTransactionReceipt(wagmiConfig, {
              hash,
              chainId,
            })
            return {
              content: [
                {
                  type: "text",
                  text: JSONStringify(result),
                },
              ],
            }
          } catch (error) {
            return {
              content: [
                {
                  type: "text",
                  text: (error as Error).message,
                },
              ],
            }
          }
        },
      });
    };
  • Top-level call to register the wait-for-transaction-receipt tool during server initialization.
    registerWaitForTransactionReceiptTools(server);
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 states the tool waits and returns a receipt, but lacks details on timeout behavior, error handling, polling intervals, or what 'included on a block' entails (e.g., confirmation depth). For a tool that involves waiting and network interaction, this is a significant gap.

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 action and outcome. There's no wasted verbiage; every word contributes to understanding the tool's function. It's appropriately sized for its purpose.

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 (waiting for blockchain transactions), lack of annotations, no output schema, and incomplete parameter documentation, the description is insufficient. It doesn't cover behavioral aspects like timeouts or errors, return values, or parameter details, making it inadequate for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 2 parameters with 0% description coverage, and the tool description adds no parameter semantics. It doesn't explain what 'hash' (transaction hash) or 'chainId' are, their formats, or why 'chainId' might be optional. With low schema coverage, the description fails to compensate, leaving parameters undocumented.

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'), 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 prerequisites (e.g., after sending a transaction), exclusions, or compare it to siblings like 'get-transaction-receipt' (which might fetch without waiting) or 'wait-seconds' (a generic delay). Usage is implied but not explicit.

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/mcpilot'

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