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
| Name | Required | Description | Default |
|---|---|---|---|
| rpcUrl | No | The RPC URL of the Arbitrum node (optional if default is set) | |
| chainName | No | Chain name (e.g., 'Xai', 'Arbitrum One') - will auto-resolve to RPC URL | |
| fromBlock | Yes | Starting block number | |
| toBlock | No | Ending block number (defaults to fromBlock if not provided) |
Implementation Reference
- src/clients/nitro-node-client.ts:172-199 (handler)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"], }, }, - src/index.ts:428-447 (handler)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 }