Skip to main content
Glama

get-transaction-receipt

Fetch transaction receipts using a transaction hash and chain ID to verify blockchain transaction details and status through MetaMask MCP server.

Instructions

Fetch the Transaction Receipt given a Transaction hash.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesA transaction hash.
chainIdNoThe ID of chain to return the transaction receipt from.

Implementation Reference

  • The tool handler function that executes the core logic: calls wagmi's getTransactionReceipt with the provided args and wagmiConfig, then returns the result as MCP text content using JSONStringify.
    execute: async (args) => {
      const result = await getTransactionReceipt(wagmiConfig, args);
      return {
        content: [
          {
            type: "text",
            text: JSONStringify(result),
          },
        ],
      };
    },
  • Tool schema including name, description, and Zod input parameters schema (hash: TransactionHash, optional chainId: number).
    name: "get-transaction-receipt",
    description: "Fetch the Transaction Receipt given a Transaction hash.",
    parameters: z.object({
      hash: TransactionHash.describe("A transaction hash."),
      chainId: z.coerce.number().optional().describe("The ID of chain to return the transaction receipt from."),
    }),
  • The registration function that defines and adds the 'get-transaction-receipt' tool to the FastMCP server.
    export function registerGetTransactionReceiptTools(server: FastMCP, wagmiConfig: Config): void {
      server.addTool({
        name: "get-transaction-receipt",
        description: "Fetch the Transaction Receipt given a Transaction hash.",
        parameters: z.object({
          hash: TransactionHash.describe("A transaction hash."),
          chainId: z.coerce.number().optional().describe("The ID of chain to return the transaction receipt from."),
        }),
        execute: async (args) => {
          const result = await getTransactionReceipt(wagmiConfig, args);
          return {
            content: [
              {
                type: "text",
                text: JSONStringify(result),
              },
            ],
          };
        },
      });
    };
  • The call to registerGetTransactionReceiptTools within the central registerTools function, which registers all tools.
    registerGetTransactionReceiptTools(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 full burden. It states the tool fetches a receipt but doesn't disclose behavioral traits like error handling (e.g., if hash is invalid or transaction pending), performance (e.g., latency, rate limits), or output format (e.g., JSON structure). This is inadequate for a tool with potential complexity in blockchain contexts.

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 with zero waste—it directly states the tool's purpose without fluff. It's front-loaded and appropriately sized for a simple fetch operation, 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 no annotations and no output schema, the description is incomplete. It doesn't cover what a transaction receipt contains (e.g., status, logs, gas used), error scenarios, or dependencies (e.g., transaction must be confirmed). For a blockchain tool with potential nuances, this leaves significant gaps in understanding.

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%, with clear descriptions for both parameters (hash and chainId). The description adds minimal value beyond the schema, only implying the hash parameter's purpose. It doesn't explain parameter interactions (e.g., chainId defaults or validation) or provide examples, so baseline 3 is appropriate.

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 action ('Fetch') and the resource ('Transaction Receipt'), specifying it requires a transaction hash. It distinguishes from sibling tools like 'get-transaction' (which fetches transaction details) and 'wait-for-transaction-receipt' (which waits for receipt availability). However, it doesn't explicitly mention the chain ID parameter, slightly limiting differentiation.

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., transaction must be mined), compare with 'get-transaction' or 'wait-for-transaction-receipt', or specify use cases like verifying transaction success. This leaves the agent without context for tool selection.

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