# Snowtrace (Avalanche Explorer) MCP

> Snowtrace (Avalanche Explorer) connects real-time Avalanche C-Chain data directly into your AI client. Check AVAX balances across single or multiple addresses, track all ERC-20 and NFT movements, and inspect contract source code and ABIs without leaving your chat window.

## Overview
- **Category:** databases
- **Price:** Free
- **Tags:** avalanche-blockchain, block-explorer, smart-contracts, crypto-analytics, transaction-tracking, web3

## Description

Snowtrace connects the full power of the Avalanche C-Chain straight into your AI client. You can check everything—from token balances to how smart contracts actually work—right in your chat window.

**Address Balance & Network Metrics:**
You'll get AVAX balances for a single address using `get_avax_balance`, or you can calculate the combined AVAX balance for up to twenty addresses with `get_avax_balance_multi`. To track market movement, use `get_avax_last_price` to grab the most recent trading price data against fiat or other major currencies. You can also run `get_avax_total_supply` to see the total amount of circulating supply available for AVAX. For network timing, `get_block_countdown` gives you an estimate of how many seconds are left until the next block is mined. To look back in time, use `get_block_number_by_time` to determine what block number was active at a specific historical timestamp. If you need to know about rewards, `get_block_reward` retrieves the amount of AVAX awarded to miners or validators for the current block.

**Token Transfer Tracking (ERC-20/NFT):**
You can audit all token movements. Use `get_erc20_transfers` to list records of every transfer involving ERC-20 fungible tokens between addresses, and `get_token_balance` gets the current balance for a single address for a specific ERC-20 token. If you want to know the total supply of an ERC-20 token, run `get_token_total_supply`. For non-fungible assets, `get_erc721_transfers` tracks and lists all transfer events for those ERC-721 NFTs. You can also get a list of all block numbers that were mined by a specific blockchain address using `get_mined_blocks`, while `get_normal_transactions` fetches standard, user-initiated transactions for an address over time.

**Contract Logic Analysis:**
Understanding contract code is straightforward with this toolset. You can use `get_contract_source_code` to retrieve the human-readable source code for a verified smart contract address. If you need to know what functions the contract supports, `get_contract_abi` gets the Application Binary Interface (ABI) detailing those functions. For deep dives into complex logic, `get_internal_transactions` shows internal calls made by a contract, which is useful for tracing function flow. Finally, `verify_source_code` confirms that the source code you provide matches the compiled bytecode on the chain.

**Transaction History & Status Checks:**
You can check transaction results thoroughly. Use `get_transaction_receipt_status` to verify the final outcome status of any given transaction receipt on the chain, and `check_contract_execution_status` confirms if a smart contract's attempt to run finished successfully or failed. To see general activity, `get_logs` retrieves all event logs emitted during transactions or state changes on the chain.

**Block and Time Mapping:**
The network functions give you context. You can determine what block number was active at any time using `get_block_number_by_time`. This entire suite lets your agent handle complex blockchain queries by pulling in everything from token movements to underlying contract structure, all without leaving your chat window.

## Tools

### get_avax_balance_multi
Calculates and returns the combined AVAX balance for up to 20 specified addresses.

### get_avax_balance
Retrieves the current AVAX balance for one single blockchain address.

### check_verify_status
Confirms whether a specific smart contract's source code has been officially verified by Snowtrace.

### get_avax_last_price
Fetches the most recent trading price data for AVAX against fiat or other major currencies.

### get_avax_total_supply
Returns the total amount of circulating supply available for AVAX.

### get_contract_abi
Gets the Application Binary Interface (ABI) that details all functions within a smart contract.

### get_block_countdown
Provides an estimate of how many seconds remain until the next block is mined.

### get_block_number_by_time
Determines what block number was active at a specific historical timestamp.

### get_block_reward
Retrieves the amount of AVAX awarded to miners or validators for the current block.

### get_logs
Retrieves general event logs emitted during transactions or state changes on the chain.

### get_contract_source_code
Retrieves the human-readable source code for a verified smart contract address.

### check_contract_execution_status
Checks if a smart contract's attempt to run finished successfully or failed.

### check_transaction_receipt_status
Verifies the final outcome status of any given transaction receipt on the chain.

### get_mined_blocks
Lists all block numbers that were mined by a specific blockchain address.

### get_token_balance
Gets the current balance of a specific ERC-20 token for a single address.

### get_erc721_transfers
Tracks and lists all transfer events for ERC-721 (NFT) non-fungible tokens.

### get_token_total_supply
Returns the total circulating supply amount for a specified ERC-20 token.

### get_erc20_transfers
Lists records of all transfers involving ERC-20 (fungible) tokens between addresses.

### get_internal_transactions
Shows the internal calls made by a contract, useful for tracing complex function logic.

### get_normal_transactions
Fetches a list of standard, user-initiated transactions for an address over time.

### verify_source_code
Confirms that the source code provided matches the compiled bytecode on the chain.

## Prompt Examples

**Prompt:** 
```
What is the current AVAX balance of 0x742d35Cc6634C0532925a3b844Bc454e4438f44e?
```

**Response:** 
```
I've checked the address on the Avalanche C-Chain. The current balance is 15.42 AVAX.
```

**Prompt:** 
```
Show me the last 5 ERC-20 transfers for wallet 0x123...
```

**Response:** 
```
Fetching recent token activity... I found 5 recent transfers, including 100 USDC received and two outgoing transfers of JOE tokens. Would you like the transaction hashes for these?
```

**Prompt:** 
```
Get the ABI for the contract at 0x60ae616a2155ee3d9a68541ba4544862310933d4.
```

**Response:** 
```
I have retrieved the ABI for the verified contract. It contains 24 functions, including `swapExactTokensForTokens` and `addLiquidity`. I can help you format a specific call if needed.
```

## Capabilities

### Address Balance & Network Metrics
Retrieve AVAX balances for one or up to 20 addresses. You can also get the current total supply, last price, and block countdown.

### Token Transfer Tracking (ERC-20/NFT)
List all recorded transfers for specific token types—ERC-20 fungible tokens or ERC-721 non-fungible assets—for auditing purposes.

### Contract Logic Analysis
Fetch the full source code and ABI for a smart contract, allowing you to understand its underlying functions and structure.

### Transaction History & Status Checks
Pull detailed transaction logs (normal or internal) for an address. You can check if a transaction receipt was successful or if the contract execution actually finished.

### Block and Time Mapping
Determine which block number corresponds to a specific timestamp, or calculate rewards based on current block data.

## Use Cases

### Tracing Missing Funds
A user spots an unusual transfer. They ask the agent to use `get_erc721_transfers` and then cross-reference those transaction hashes using `get_internal_transactions`. The agent reveals that the NFT was passed through a specific contract, solving the mystery of where the funds went.

### Vetting New DeFi Protocols
A developer needs to trust a new lending protocol. They ask the agent to use `get_contract_source_code` and then run `verify_source_code`. If the code verification passes, they can proceed with confidence; otherwise, they know not to touch it.

### Compiling Portfolio Value
A data analyst needs a snapshot of 15 different wallets. Instead of running 15 separate balance checks, they ask the agent to use `get_avax_balance_multi`. They get the full portfolio value instantly, allowing them to finish their report early.

### Debugging State Changes
A user sees a contract's state changed but doesn't know why. They ask for `get_logs` and then check the associated transactions using `get_normal_transactions`. The agent combines these logs to pinpoint the exact function call that triggered the state change.

## Benefits

- See all asset movements immediately. You track every ERC-20 transfer using `get_erc20_transfers` or monitor NFT sales with `get_erc721_transfers`, eliminating manual explorer tabs.
- Debug contracts on the fly. Get the full source code and ABI via `get_contract_source_code` and `get_contract_abi`. You instantly know what a protocol is designed to do, without guessing.
- Audit transaction failures. Instead of just seeing 'failed,' you use `check_transaction_receipt_status` to confirm *why* the contract execution failed or if it was due to gas limits.
- Batch balance checks are fast. Use `get_avax_balance_multi` to check up to 20 wallets at once, saving dozens of individual API calls and time.
- Understand the network depth. You can map timestamps to block numbers using `get_block_number_by_time`, giving you a precise historical anchor point for any research.

## How It Works

The bottom line is that your AI client acts as a dedicated blockchain node for Avalanche, letting you run complex queries without writing code or leaving the chat.

1. Subscribe to the Snowtrace server on Vinkius and enter your API key.
2. Ask your AI client for blockchain data (e.g., "What is the ERC-20 balance of this address?").
3. The agent calls the necessary tools, retrieves structured data from the Avalanche C-Chain, and presents the answer in plain text.

## Frequently Asked Questions

**How do I check the balance of many wallets using get_avax_balance_multi?**
You pass a list of up to 20 wallet addresses in one query. This tool aggregates all balances, so you only need one call instead of running `get_avax_balance` repeatedly.

**What is the difference between get_normal_transactions and get_internal_transactions?**
`get_normal_transactions` shows transactions initiated by a user's wallet. `get_internal_transactions` tracks calls made *by* a smart contract to other contracts, which is key for understanding complex DeFi logic.

**Do I need get_contract_source_code if I already have the ABI?**
No, they are different. The ABI (`get_contract_abi`) tells you *what* functions exist (inputs/outputs), but the source code (`get_contract_source_code`) shows you *how* those functions work.

**If I run a transaction, how do I know if it really went through?**
Always follow up with `check_transaction_receipt_status`. This tool gives the definitive answer on whether the blockchain accepted and processed the transaction successfully.

**What happens if I run many queries with get_normal_transactions in a short time?**
You might hit rate limits. The server enforces usage caps to prevent abuse, so watch out for 429 errors. If you see one, slow down your requests and implement an exponential back-off strategy.

**When using get_erc20_transfers, can I filter the results by a specific contract address?**
Yes, most transfer tools allow filtering. You typically pass the target contract's unique address as a required parameter. This narrows down the event data to only tokens from that source.

**How do I know if my API key is set up correctly before querying get_avax_balance?**
If you get an authentication error (usually a 401 status), your key isn't working. Double-check that the key hasn't expired and that the server connection string in your agent is correct.

**Does check_contract_execution_status differentiate between logic failures and network issues?**
It does. The status code reveals if the failure was due to insufficient gas (a contract logic fault) or a different type of transaction rejection, letting you pinpoint the exact problem.

**Can I check the balance of multiple Avalanche addresses at once?**
Yes. Use the `get_avax_balance_multi` tool and provide a comma-separated list of up to 20 addresses to get all balances in a single response.

**How do I track specific token movements like USDT or NFTs?**
You can use `get_erc20_transfers` for standard tokens or `get_erc721_transfers` for NFTs. You can filter by wallet address or specific contract address to narrow down the results.

**Is it possible to see the source code of a verified contract?**
Absolutely. The `get_contract_source_code` tool retrieves the verified Solidity source code and metadata for any contract address that has been verified on Snowtrace.