Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

node_peers

Retrieve connected peers data from Arbitrum nodes for monitoring and analysis. Requires admin API access to access node details and ensure accurate network insights.

Instructions

Get connected peers information (requires admin API access - will not work with public RPCs)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rpcUrlNoThe RPC URL of the Arbitrum node (optional if default is set)

Implementation Reference

  • Core implementation of getPeers() method in NitroNodeClient that performs the 'admin_peers' RPC call and maps the response to PeerInfo objects.
    async getPeers(): Promise<PeerInfo[] | { error: string }> { try { const peers = await this.makeRpcCall("admin_peers", []); return peers.map((peer: any) => ({ id: peer.id, name: peer.name, caps: peer.caps, network: peer.network, protocols: peer.protocols, })); } catch (error) { return { error: "Peer information not supported on this RPC endpoint. This method typically requires access to a node's admin API.", }; } }
  • MCP server handler for the 'node_peers' tool: resolves RPC URL using chainLookupService, instantiates NitroNodeClient, calls getPeers(), and formats response as JSON text.
    case "node_peers": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const nodeClient = new NitroNodeClient(rpcUrl); const peers = await nodeClient.getPeers(); return { content: [ { type: "text", text: JSON.stringify(peers, null, 2), }, ], }; }
  • src/index.ts:891-906 (registration)
    Tool registration in getAvailableTools(): defines name, description, and inputSchema for 'node_peers' tool.
    { name: "node_peers", description: "Get connected peers information (requires admin API access - will not work with public RPCs)", inputSchema: { type: "object" as const, properties: { rpcUrl: { type: "string", description: "The RPC URL of the Arbitrum node (optional if default is set)", }, }, required: [], }, },
  • TypeScript interface defining the structure of PeerInfo returned by getPeers() method.
    export interface PeerInfo { id: string; name: string; caps: string[]; network: { localAddress: string; remoteAddress: string; }; protocols: Record<string, any>; }

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