Network Information Tools
These tools provide essential information about the Somnia blockchain network, including chain details, gas prices, and block information.
get_chain_info
Section titled “get_chain_info”Retrieves information about a specific Somnia network.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)
Example:
{ "network": "Somnia Testnet"}
Response: Returns chain information including name, chain ID, RPC URLs, and native currency details.
Example Prompt:
Get the chain info for Somnia Testnet.
get_gas_price
Section titled “get_gas_price”Gets the current gas price on the network.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)
Example:
{ "network": "Somnia Testnet"}
Response: Returns the current gas price in wei.
Example Prompt:
What is the current gas price on Somnia Testnet?
get_fee_data
Section titled “get_fee_data”Retrieves complete fee data including gas price, max fee per gas, and max priority fee per gas.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)
Example:
{ "network": "Somnia Testnet"}
Response: Returns an object with gasPrice, maxFeePerGas, and maxPriorityFeePerGas.
Example Prompt:
Get the complete fee data for Somnia Testnet.
get_block_number
Section titled “get_block_number”Gets information about a specific block by its number.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)blockNumber
(optional): Block number to retrieve (defaults to latest)
Example:
{ "network": "Somnia Testnet", "blockNumber": 1234567}
Response: Returns complete block data including transactions, timestamp, and gas used.
Example Prompt:
Get information about block number 1234567.
get_latest_block
Section titled “get_latest_block”Retrieves the most recent block from the network.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)
Example:
{ "network": "Somnia Testnet"}
Response: Returns the latest block information.
Example Prompt:
What is the latest block on the network?
get_ens_name
Section titled “get_ens_name”Resolves an ENS name to its corresponding address.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)ensName
: The ENS name to resolve (e.g., ‘alice.eth’, ‘bob.somnia’)
Example:
{ "network": "Somnia Testnet", "ensName": "alice.somnia"}
Response: Returns the resolved address for the ENS name.
Example Prompt:
Resolve the ENS name 'alice.somnia' to its address.
reverse_ens_name
Section titled “reverse_ens_name”Gets the ENS name associated with an address.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)address
: The address to reverse lookup
Example:
{ "network": "Somnia Testnet", "address": "0x1234567890123456789012345678901234567890"}
Response: Returns the ENS name associated with the address, if any.
Example Prompt:
Get the ENS name for address 0x1234567890123456789012345678901234567890.
Error Handling
Section titled “Error Handling”All network tools will return error messages if:
- The specified network is not supported
- Network connection fails
- Block number is invalid or not found