Skip to main content
Glama

net_getPeerCount

Retrieve the number of connected peers on Ethereum networks to monitor network connectivity and health.

Instructions

Returns the number of peers currently connected to the client. Useful for monitoring network connectivity and health.

Args:

  • network (string, optional): Ethereum network to query, defaults to 'mainnet'

Returns:

  • Hex-encoded integer representing the number of connected peers (e.g., '0x19' for 25 peers)

Examples:

  • "Get mainnet peer count": {}

  • "Get Sepolia peer count": { "network": "sepolia" }

Errors:

  • InternalError: When Infura API is unavailable

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoThe Ethereum network to query, e.g., 'mainnet' or 'sepolia'.mainnet
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable.json
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility. It discloses return format (hex-encoded integer), default network, error cases (InternalError), and usage examples. However, it does not explicitly state read-only or non-destructive nature, but context implies it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concisely structured into clear sections (purpose, args, returns, examples, errors). Each sentence is informative and earns its place, with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with no output schema, the description covers return format, parameter details, examples, and errors. It is sufficiently complete for an agent to understand and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (baseline 3). The description adds value for the 'network' parameter via examples and default, but does not mention the 'response_format' parameter, which is only defined in the schema. Thus, it partially adds meaning but misses one parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it returns the number of connected peers, with a verb 'returns' and specific resource. It differentiates itself from sibling tools like net_getVersion and net_isListening by focusing on peer count, a distinct metric.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide explicit guidance on when to use this tool versus alternatives. It only states it's useful for monitoring connectivity, but lacks comparison or exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Qbandev/infura-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server