Network Tools
Tools for interacting with blockchain networks, chain information, and RPC endpoints.
network_get_info
Get comprehensive information about the current network.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
network |
string | No | ethereum |
Target network |
Response Schema
{
chainId: number; // Chain ID (e.g., 1 for Ethereum)
name: string; // Network name
nativeCurrency: {
name: string; // "Ether"
symbol: string; // "ETH"
decimals: number; // 18
};
blockNumber: number; // Current block number
gasPrice: string; // Current gas price in Gwei
rpcUrl: string; // Active RPC endpoint
explorerUrl: string; // Block explorer URL
}
Example Usage
// Using MCP client
const result = await client.callTool('network_get_info', {
network: 'arbitrum'
});
// Response
{
"chainId": 42161,
"name": "Arbitrum One",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"blockNumber": 175234567,
"gasPrice": "0.1",
"rpcUrl": "https://arb1.arbitrum.io/rpc",
"explorerUrl": "https://arbiscan.io"
}
Related Tools
network_get_chain_id
Get the chain ID for the current network.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
network |
string | No | ethereum |
Target network |
Response Schema
Example Usage
const result = await client.callTool('network_get_chain_id', {
network: 'bsc'
});
// Response
{
"chainId": 56,
"networkName": "BNB Smart Chain"
}
network_get_block_number
Get the latest block number.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
network |
string | No | ethereum |
Target network |
Response Schema
Example Usage
const result = await client.callTool('network_get_block_number', {
network: 'polygon'
});
// Response
{
"blockNumber": 52345678,
"timestamp": 1706284800,
"network": "polygon"
}
network_get_gas_price
Get current gas prices with EIP-1559 support.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
network |
string | No | ethereum |
Target network |
Response Schema
{
legacy: {
gasPrice: string; // Gas price in Gwei
};
eip1559: {
baseFee: string; // Base fee in Gwei
maxPriorityFee: string; // Priority fee in Gwei
maxFee: string; // Max fee in Gwei
};
suggestions: {
slow: string; // Low priority gas price
standard: string; // Standard gas price
fast: string; // Fast gas price
instant: string; // Instant gas price
};
}
Example Usage
const result = await client.callTool('network_get_gas_price', {
network: 'ethereum'
});
// Response
{
"legacy": {
"gasPrice": "25.5"
},
"eip1559": {
"baseFee": "20.0",
"maxPriorityFee": "2.0",
"maxFee": "42.0"
},
"suggestions": {
"slow": "22.0",
"standard": "25.0",
"fast": "30.0",
"instant": "40.0"
}
}
Related Tools
network_list_supported
List all supported networks and their configurations.
Parameters
None
Response Schema
{
networks: Array<{
id: string; // Network identifier
name: string; // Display name
chainId: number; // Chain ID
nativeCurrency: string; // Native token symbol
rpcUrl: string; // Default RPC URL
explorerUrl: string; // Block explorer URL
testnet: boolean; // Is testnet
}>;
total: number;
}
Example Usage
const result = await client.callTool('network_list_supported', {});
// Response
{
"networks": [
{
"id": "ethereum",
"name": "Ethereum Mainnet",
"chainId": 1,
"nativeCurrency": "ETH",
"rpcUrl": "https://eth.llamarpc.com",
"explorerUrl": "https://etherscan.io",
"testnet": false
},
{
"id": "bsc",
"name": "BNB Smart Chain",
"chainId": 56,
"nativeCurrency": "BNB",
"rpcUrl": "https://bsc-dataseed.binance.org",
"explorerUrl": "https://bscscan.com",
"testnet": false
},
// ... more networks
],
"total": 12
}
network_get_rpc_endpoints
Get available RPC endpoints for a network.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
network |
string | No | ethereum |
Target network |
includePrivate |
boolean | No | false |
Include private RPCs |
Response Schema
{
network: string;
endpoints: Array<{
url: string;
provider: string;
type: 'public' | 'private';
latency?: number;
status: 'healthy' | 'degraded' | 'down';
}>;
}
Example Usage
const result = await client.callTool('network_get_rpc_endpoints', {
network: 'arbitrum'
});
// Response
{
"network": "arbitrum",
"endpoints": [
{
"url": "https://arb1.arbitrum.io/rpc",
"provider": "Arbitrum Foundation",
"type": "public",
"latency": 45,
"status": "healthy"
},
{
"url": "https://arbitrum.llamarpc.com",
"provider": "LlamaNodes",
"type": "public",
"latency": 62,
"status": "healthy"
}
]
}
network_get_status
Check network health and status.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
network |
string | No | ethereum |
Target network |
Response Schema
{
network: string;
status: 'healthy' | 'degraded' | 'down';
blockTime: number; // Average block time in seconds
peerCount: number; // Number of connected peers
isSyncing: boolean; // Is node syncing
latestBlock: number;
finalizedBlock: number;
pendingTransactions: number;
}
Example Usage
const result = await client.callTool('network_get_status', {
network: 'ethereum'
});
// Response
{
"network": "ethereum",
"status": "healthy",
"blockTime": 12.1,
"peerCount": 125,
"isSyncing": false,
"latestBlock": 19234567,
"finalizedBlock": 19234535,
"pendingTransactions": 45678
}
network_estimate_block_time
Estimate time for a future block.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
network |
string | No | ethereum |
Target network |
targetBlock |
number | Yes | - | Target block number |
Response Schema
{
currentBlock: number;
targetBlock: number;
blocksRemaining: number;
estimatedSeconds: number;
estimatedTime: string; // ISO timestamp
averageBlockTime: number;
}
Example Usage
const result = await client.callTool('network_estimate_block_time', {
network: 'ethereum',
targetBlock: 19300000
});
// Response
{
"currentBlock": 19234567,
"targetBlock": 19300000,
"blocksRemaining": 65433,
"estimatedSeconds": 791919,
"estimatedTime": "2024-02-05T10:30:00Z",
"averageBlockTime": 12.1
}
network_get_mempool
Get pending transactions in the mempool.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
network |
string | No | ethereum |
Target network |
limit |
number | No | 20 |
Max transactions to return |
Response Schema
{
network: string;
pendingCount: number;
transactions: Array<{
hash: string;
from: string;
to: string;
value: string;
gasPrice: string;
nonce: number;
}>;
}
Example Usage
const result = await client.callTool('network_get_mempool', {
network: 'ethereum',
limit: 10
});
// Response
{
"network": "ethereum",
"pendingCount": 45678,
"transactions": [
{
"hash": "0x1234...",
"from": "0xabc...",
"to": "0xdef...",
"value": "1.5",
"gasPrice": "30.0",
"nonce": 42
}
// ... more transactions
]
}
network_switch
Switch the active network for subsequent operations.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
network |
string | Yes | - | Network to switch to |
Response Schema
Example Usage
const result = await client.callTool('network_switch', {
network: 'polygon'
});
// Response
{
"success": true,
"previousNetwork": "ethereum",
"currentNetwork": "polygon",
"chainId": 137
}
Error Handling
Common Errors
| Error Code | Description | Solution |
|---|---|---|
NETWORK_NOT_FOUND |
Unsupported network | Use network_list_supported to see available networks |
RPC_ERROR |
RPC endpoint failure | Try different endpoint or network |
RATE_LIMIT |
Too many requests | Implement request throttling |
Example Error Response
{
"content": [{
"type": "text",
"text": "Error: Network 'invalid_network' not supported. Use network_list_supported to see available networks."
}],
"isError": true
}
Best Practices
- Cache network info - Network configuration rarely changes
- Use appropriate network - Choose based on use case (testnet for development)
- Monitor gas prices - Query before transactions to optimize costs
- Handle RPC failures - Implement fallback endpoints
- Check finality - For critical operations, wait for block finalization