Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

arb_get_raw_block_metadata

Retrieve raw block metadata for specified block ranges from Arbitrum networks using admin API access.

Instructions

Retrieve raw block metadata for specified block ranges (requires admin API)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rpcUrlNoThe RPC URL of the Arbitrum node (optional if default is set)
chainNameNoChain name (e.g., 'Xai', 'Arbitrum One') - will auto-resolve to RPC URL
fromBlockYesStarting block number
toBlockNoEnding block number (defaults to fromBlock if not provided)

Implementation Reference

  • Core handler function that executes the RPC call to arb_getRawBlockMetadata and processes the response into BlockMetadata array
    async getRawBlockMetadata( fromBlock: number, toBlock: number ): Promise<BlockMetadata[] | { error: string }> { try { const result = await this.makeRpcCall("arb_getRawBlockMetadata", [ `0x${fromBlock.toString(16)}`, `0x${toBlock.toString(16)}`, ]); if (Array.isArray(result)) { return result.map((item: any) => ({ blockNumber: parseInt(item.blockNumber, 16), metadata: item.metadata || item.rawMetadata, })); } return { error: "Unexpected response format from arb_getRawBlockMetadata", }; } catch (error) { return { error: `Raw block metadata not supported on this RPC endpoint: ${ (error as Error).message }`, }; } }
  • src/index.ts:1119-1148 (registration)
    Tool registration including name, description, and input schema definition in getAvailableTools()
    { name: "arb_get_raw_block_metadata", description: "Retrieve raw block metadata for specified block ranges (requires admin API)", inputSchema: { type: "object" as const, properties: { rpcUrl: { type: "string", description: "The RPC URL of the Arbitrum node (optional if default is set)", }, chainName: { type: "string", description: "Chain name (e.g., 'Xai', 'Arbitrum One') - will auto-resolve to RPC URL", }, fromBlock: { type: "number", description: "Starting block number", }, toBlock: { type: "number", description: "Ending block number (defaults to fromBlock if not provided)", }, }, required: ["fromBlock"], }, },
  • MCP CallToolRequestSchema handler that instantiates NitroNodeClient and invokes the tool logic
    case "arb_get_raw_block_metadata": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const nodeClient = new NitroNodeClient(rpcUrl); const fromBlock = (args.fromBlock as number) || 0; const toBlock = (args.toBlock as number) || fromBlock; const metadata = await nodeClient.getRawBlockMetadata( fromBlock, toBlock ); return { content: [ { type: "text", text: JSON.stringify(metadata, null, 2), }, ], }; }
  • TypeScript interface defining the output structure for block metadata
    export interface BlockMetadata { blockNumber: number; metadata: string; // Raw metadata bytes as hex 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