Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

get_transaction

Retrieve transaction details by hash from Arbitrum networks to analyze blockchain activity and verify transaction status.

Instructions

Get transaction details by hash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rpcUrlNoThe RPC URL of the chain (optional if default is set)
txHashYesTransaction hash

Implementation Reference

  • Main handler for the 'get_transaction' MCP tool. Resolves the RPC URL using chain name or provided URL, creates an EthereumAccountClient instance, fetches the transaction by hash, and returns the JSON-formatted transaction details.
    case "get_transaction": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const ethereumAccountClient = new EthereumAccountClient(rpcUrl); const tx = await ethereumAccountClient.getTransaction( args.txHash as string ); return { content: [ { type: "text", text: JSON.stringify(tx, null, 2), }, ], }; }
  • Tool schema definition including input schema for 'get_transaction', specifying parameters rpcUrl (optional) and required txHash. Used in list tools response for registration.
    { name: "get_transaction", description: "Get transaction details by hash", inputSchema: { type: "object" as const, properties: { rpcUrl: { type: "string", description: "The RPC URL of the chain (optional if default is set)", }, txHash: { type: "string", description: "Transaction hash", }, }, required: ["txHash"], }, },
  • Core helper function that performs the eth_getTransactionByHash RPC call, parses the raw transaction response into a typed Transaction object, and handles missing transaction errors.
    async getTransaction(txHash: string): Promise<Transaction> { const tx = await this.makeRpcCall('eth_getTransactionByHash', [txHash]); if (!tx) { throw new Error(`Transaction ${txHash} not found`); } return { hash: tx.hash, nonce: parseInt(tx.nonce, 16), blockHash: tx.blockHash, blockNumber: tx.blockNumber ? parseInt(tx.blockNumber, 16) : null, transactionIndex: tx.transactionIndex ? parseInt(tx.transactionIndex, 16) : null, from: tx.from, to: tx.to, value: tx.value, gasPrice: tx.gasPrice, gas: parseInt(tx.gas, 16), input: tx.input }; }
  • TypeScript interface defining the structure of the Transaction object returned by the getTransaction helper.
    export interface Transaction { hash: string; nonce: number; blockHash: string | null; blockNumber: number | null; transactionIndex: number | null; from: string; to: string | null; value: string; gasPrice: string; gas: number; input: string; }

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/dewanshparashar/arbitrum-mcp'

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