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);

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