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
| Name | Required | Description | Default |
|---|---|---|---|
| hash | Yes | A transaction hash. | |
| chainId | No | The 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."), }),
- src/tools/get-transaction-receipt.ts:8-28 (registration)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), }, ], }; }, }); };
- src/tools/register-tools.ts:49-49 (registration)The call to registerGetTransactionReceiptTools within the central registerTools function, which registers all tools.registerGetTransactionReceiptTools(server, wagmiConfig);