Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

get_transaction

Retrieve detailed transaction information by providing a transaction hash. Works with Arbitrum Nitro nodes and chains, enabling precise chain health monitoring and node operations.

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

  • MCP tool handler for 'get_transaction': resolves RPC URL or chain name, instantiates EthereumAccountClient, fetches transaction by txHash, and returns 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), }, ], }; }
  • src/index.ts:982-999 (registration)
    Tool registration in getAvailableTools(): defines name 'get_transaction', description, and input schema requiring txHash (rpcUrl optional).
    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"], }, },
  • TypeScript interface defining the structure of a Transaction object returned by the tool.
    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; }
  • Core helper function getTransaction: performs eth_getTransactionByHash RPC call via makeRpcCall, parses raw response into typed Transaction, handles not found error.
    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 }; }

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