Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

arb_get_raw_block_metadata

Retrieve raw block metadata for specified block ranges on Arbitrum chains using admin API, enabling detailed chain monitoring and analysis.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNameNoChain name (e.g., 'Xai', 'Arbitrum One') - will auto-resolve to RPC URL
fromBlockYesStarting block number
rpcUrlNoThe RPC URL of the Arbitrum node (optional if default is set)
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 }`, }; } }
  • MCP server request handler that resolves the RPC URL or chain name and delegates to NitroNodeClient.getRawBlockMetadata
    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), }, ], }; }
  • src/index.ts:1120-1148 (registration)
    Tool registration in the list of available tools, including name, description, and input schema definition
    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"], }, },
  • TypeScript interface defining the structure of individual block metadata returned by the handler
    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