provider_get_transaction
Retrieve Ethereum or EVM-compatible blockchain transaction details by inputting the transaction hash, enabling efficient blockchain query and analysis.
Instructions
Get a transaction by hash
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| transactionHash | Yes | The transaction hash |
Implementation Reference
- src/handlers/wallet.ts:519-536 (handler)The handler function that executes the logic for retrieving a transaction by hash using the ethers provider.export const getTransactionHandler = async (input: any): Promise<ToolResultSchema> => { try { if (!input.transactionHash) { return createErrorResponse("Transaction hash is required"); } const provider = getProvider(); const transaction = await provider.getTransaction(input.transactionHash); return createSuccessResponse( `Transaction retrieved successfully Transaction hash: ${input.transactionHash} Transaction: ${transaction} `); } catch (error) { return createErrorResponse(`Failed to get transaction: ${(error as Error).message}`); } };
- src/tools.ts:404-412 (schema)The input schema defining the parameters for the provider_get_transaction tool.name: "provider_get_transaction", description: "Get a transaction by hash", inputSchema: { type: "object", properties: { transactionHash: { type: "string", description: "The transaction hash" } }, required: ["transactionHash"] }
- src/tools.ts:591-591 (registration)The registration mapping the tool name 'provider_get_transaction' to its handler function in the handlers dictionary."provider_get_transaction": getTransactionHandler,