get-transaction
Retrieve blockchain transaction details using transaction hashes or chain identifiers to verify and analyze on-chain activity through secure wallet integration.
Instructions
Get the transactions given hashes or chain identifiers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hash | Yes | ||
| chainId | No |
Implementation Reference
- Handler function that retrieves the transaction using wagmi's getTransaction based on hash and optional chainId, then returns it as JSON stringified text content.execute: async (args) => { const hash = args.hash as Address const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id'] const result = await getTransaction(wagmiConfig, { hash, chainId, }) return { content: [ { type: "text", text: JSONStringify(result), }, ], } },
- Zod schema defining the input parameters: hash (string) and optional chainId (number).parameters: z.object({ hash: z.string(), chainId: z.coerce.number().optional(), }),
- packages/metamask-mcp/src/index.ts:53-53 (registration)Registers the get-transaction tool on the FastMCP server instance.registerGetTransactionTools(server);