Skip to content

Balance Tools

These tools allow you to query the balance of addresses on the Somnia network, including native SST/SOMI tokens and ERC20 tokens.

Gets the SST (native token) balance of an address.

Parameters:

  • network (optional): Network name or chain ID (defaults to Somnia testnet)
  • address: The address to check balance for

Example:

{
"network": "Somnia Testnet",
"address": "0x1234567890123456789012345678901234567890"
}

Response: Returns an object with address, network, balance in wei, and formatted SST balance.

Example Prompt:

What is the SST balance of address 0x1234567890123456789012345678901234567890?

Gets the balance of an ERC20 token for a specific address.

Parameters:

  • network (optional): Network name or chain ID (defaults to Somnia testnet)
  • tokenAddress: The ERC20 token contract address
  • address: The address to check balance for

Example:

{
"network": "Somnia Testnet",
"tokenAddress": "0xabcdef1234567890abcdef1234567890abcdef12",
"address": "0x1234567890123456789012345678901234567890"
}

Response: Returns raw balance, formatted balance, and token information (symbol, decimals).

Example Prompt:

Get the balance of ERC20 token 0xabcdef1234567890abcdef1234567890abcdef12 for address 0x1234567890123456789012345678901234567890.

Alternative tool for getting ERC20 token balance (same as get_erc20_balance).

Parameters:

  • network (optional): Network name or chain ID (defaults to Somnia testnet)
  • tokenAddress: The ERC20 token contract address
  • address: The address to check balance for

Example:

{
"network": "Somnia Testnet",
"tokenAddress": "0xabcdef1234567890abcdef1234567890abcdef12",
"address": "0x1234567890123456789012345678901234567890"
}

Response: Returns balance information with raw and formatted values.

Example Prompt:

Check the ERC20 token balance for address 0x1234567890123456789012345678901234567890 on token 0xabcdef1234567890abcdef1234567890abcdef12.

Gets the NFT (ERC721) balance for an address.

Parameters:

  • network (optional): Network name or chain ID (defaults to Somnia testnet)
  • tokenAddress: The NFT contract address
  • address: The address to check balance for

Example:

{
"network": "Somnia Testnet",
"tokenAddress": "0xabcdef1234567890abcdef1234567890abcdef12",
"address": "0x1234567890123456789012345678901234567890"
}

Response: Returns the number of NFTs owned by the address in the collection.

Example Prompt:

How many NFTs does address 0x1234567890123456789012345678901234567890 own in collection 0xabcdef1234567890abcdef1234567890abcdef12?

Balance tools may return errors if:

  • The address format is invalid
  • The token contract doesn’t exist or isn’t an ERC20/ERC721
  • Network connection issues occur
  • The address has no balance (returns 0, not an error)