Skip to main content
Glama

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
NameRequiredDescriptionDefault
transactionHashYesThe transaction hash

Implementation Reference

  • 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}`);
      }
    };
  • 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,

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/dcSpark/mcp-cryptowallet-evm'

If you have feedback or need assistance with the MCP directory API, please join our Discord server