# Moonscan MCP

> Moonscan (Moonbeam Network Explorer) gives your AI client direct access to Moonbeam blockchain data. Check GLMR balances for single or multiple addresses, track all token types (ERC-20, NFTs, ERC-1155), and inspect smart contract source code—all without leaving your chat window.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** moonbeam, glmr, blockchain-explorer, smart-contracts, web3

## Description

**Moonscan Moonbeam Explorer** hooks your AI client up straight to the Moonbeam blockchain data. You don't gotta jump between explorers or copy-paste raw addresses into different tabs; you just ask, and your agent handles it all inside your chat window. This server gives you direct access to GLMR balances, tracks every token type, and lets you inspect contract source code—it’s everything in one place.

**Checking Balances and Supplies**

Need to know how much GLMR a wallet holds? Use `get_glmr_balance` for a single address or run `get_glmr_balance_multi` if you've got a list of wallets. You can also check the overall picture with `get_glmr_total_supply`. For ERC-20 tokens, `get_erc20_balance` pulls up an account’s current holding. If you wanna see what the whole token economy looks like, use `get_erc20_total_supply`. It'll give you the total circulating supply number.

**Tracking Multi-Asset Transfers**

When it comes to moving tokens, you can track three different types of assets. For standard ERC-20 fungible tokens, `get_erc20_transfers` lists all recent movements between addresses. If you're dealing with NFTs, use `get_erc721_transfers` to get a history of those unique token transfers. And for multi-token contracts using the ERC-1155 standard, run `get_erc1155_transfers` to list all recent events.

**Deep Dive into Transactions and Contracts**

Don't trust just looking at the surface level of a transaction. You can pull up standard successful transactions using `get_normal_transactions`, but for a deeper look, use `get_internal_transactions`. This tool pulls out all the function calls that happened *inside* the main transaction—that’s critical context. If you need to debug what went down, `get_logs` fetches raw event logs directly from the blockchain. To verify if any given action succeeded or failed, check the result with `get_tx_receipt_status`, or use `get_contract_execution_status`. 

When it comes to smart contracts themselves, you've got options for deep analysis. You can pull up the full Application Binary Interface (ABI) using `get_contract_abi`; this tells your agent exactly what functions the contract supports. If you need to know how the code works, `get_contract_source_code` retrieves the whole verified source code. You can also run a read-only function call on any contract without spending gas by executing `proxy_eth_call`, and if you just want to check out the raw details of a block number, use `proxy_eth_get_block_by_number`. 

**Checking Network State and Gas Costs**

For understanding the network's current state, your agent can estimate how many blocks are left until the next one mines using `get_block_countdown`, or it can calculate which block number corresponds to a specific time stamp with `get_block_number_by_time`. You don't gotta guess gas prices; use `proxy_eth_gas_price` for the current rate. If you're planning a transaction, run `proxy_eth_estimate_gas` first to see how much gas you'll need. Finally, if you just want the most recent trading price of GLMR, call `get_glmr_last_price`.

## Tools

### get_block_countdown
Estimates how many blocks are left until the next block is mined.

### get_block_number_by_time
Returns the blockchain block number corresponding to a specific Unix timestamp.

### get_block_reward
Retrieves the reward value associated with mining a new block.

### get_contract_abi
Fetches the Application Binary Interface (ABI) for a given contract address.

### get_contract_execution_status
Checks if a specific smart contract execution attempt was successful or failed.

### get_contract_source_code
Retrieves the full source code for a verified smart contract address.

### get_erc1155_transfers
Lists all recent transfer events for ERC-1155 multi-token contracts.

### get_erc20_balance
Gets the current balance of an ERC-20 token for a single address.

### get_erc20_total_supply
Retrieves the total circulating supply amount for a specified ERC-20 token contract.

### get_erc20_transfers
Lists all recent transfer events for standard ERC-20 tokens between addresses.

### get_erc721_transfers
Gets a list of historical transfers involving Non-Fungible Tokens (NFTs).

### get_glmr_balance_multi
Retrieves GLMR balances for a list of multiple addresses at once.

### get_glmr_balance
Checks the GLMR token balance for one specific wallet address.

### get_glmr_last_price
Returns the most recent recorded trading price for GLMR.

### get_glmr_total_supply
Provides the total circulating supply amount of the GLMR token.

### get_internal_transactions
Retrieves a list of internal contract function calls that occurred during transactions.

### get_logs
Fetches raw event logs emitted by the blockchain for debugging purposes.

### get_normal_transactions
Lists standard, successful transactions that moved assets or called functions.

### get_tx_receipt_status
Verifies the final status (success/fail) of a specific transaction hash.

### proxy_eth_block_number
Gets the current blockchain block number using the standard eth_blockNumber call.

### proxy_eth_call
Executes a read-only function call on a contract without spending gas.

### proxy_eth_estimate_gas
Estimates the amount of gas required for an intended transaction or call.

### proxy_eth_gas_price
Returns the current recommended price for one unit of gas on the network.

### proxy_eth_get_block_by_number
Fetches all data details for a block given its specific number.

### proxy_eth_get_transaction_by_hash
Retrieves core metadata about a transaction using its unique hash.

### proxy_eth_get_transaction_receipt
Gets the detailed receipt, including gas usage and outcome, for completed transactions.

## Prompt Examples

**Prompt:** 
```
What is the current GLMR balance for 0x21130d97301b6A5723dC95ca7519483491744ef1?
```

**Response:** 
```
The address 0x2113... currently holds 1,250.45 GLMR.
```

**Prompt:** 
```
List the last 5 normal transactions for address 0x21130d97301b6A5723dC95ca7519483491744ef1 sorted by desc.
```

**Response:** 
```
I've retrieved the 5 most recent transactions. The latest one was a transfer of 50 GLMR to 0xabc... at block 4,500,123.
```

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

**Response:** 
```
I have successfully retrieved the ABI for the contract. It includes functions like `transfer`, `balanceOf`, and `approve`. Would you like me to explain any specific function?
```

## Capabilities

### Token Balance & Supply Management
Check current GLMR, ERC-20, and total token supplies for any given address or contract.

### Multi-Asset Transfer Tracking
Retrieve historical lists of transfers for ERC-20 (fungible tokens), ERC-721 (NFTs), and ERC-1155 (multi-token) contracts.

### Transaction & Block State Reading
Fetch normal transaction logs, internal operations, block numbers by time, and estimate gas prices using proxy tools.

### Smart Contract Code Inspection
Retrieve the full ABI or source code of a contract address for deep functional analysis.

## Use Cases

### Verifying a complex NFT sale
A user needs to confirm if an NFT transfer was legitimate. They ask their agent, 'Show me the transfers for this contract address.' The agent runs `get_erc721_transfers`, providing a chronological list of ownership changes. This confirms the asset moved correctly and shows exactly when.

### Auditing token supply after an event
A developer suspects a recent smart contract interaction altered the total circulating tokens. They ask for 'the current GLMR total supply.' The agent runs `get_glmr_total_supply`, giving them the definitive, immediate number to cross-reference with prior data.

### Debugging an internal transaction failure
A user sees a failed transaction hash. They ask, 'What went wrong with this tx?' The agent runs `get_tx_receipt_status` and then uses `get_internal_transactions`, pinpointing the exact function call within the contract that caused the failure.

### Comparing multiple wallet balances
A quant researcher needs to check four different associated wallets. Instead of running the balance check four times, they run `get_glmr_balance_multi`, feeding all addresses into one request and getting a consolidated report.

## Benefits

- Balance checks are instant. Instead of visiting a separate explorer for GLMR or ERC-20 holdings, just ask your agent to run `get_glmr_balance` or `get_erc20_balance`. You get the number right in chat.
- Full token lifecycle visibility. Track every asset type—ERC-20 via `get_erc20_transfers`, NFTs with `get_erc721_transfers`, and multi-token assets with `get_erc1155_transfers`—from one command set.
- Deep contract inspection. Don't guess what a contract does. Use `get_contract_abi` to see the full function list, or run `get_contract_source_code` for the raw Solidity code.
- Debugging is faster than ever. Check transaction outcomes immediately using `get_tx_receipt_status`. Know if that transfer failed or succeeded without leaving your terminal.
- Understand block mechanics. Use tools like `get_block_number_by_time` to map a specific timestamp back to a precise blockchain block number.

## How It Works

The bottom line is, you get complex on-chain data analyzed by an AI without having to switch tools or open a web browser.

1. Subscribe to this server and provide your Moonscan API Key.
2. Ask your AI client to perform an action (e.g., 'What was the total supply of GLMR?').
3. The agent runs the necessary tool (`get_glmr_total_supply`) and delivers the data directly into your conversation.

## Frequently Asked Questions

**How do I check if a transaction actually succeeded using get_tx_receipt_status?**
You pass the unique transaction hash to `get_tx_receipt_status`. The tool returns the receipt status, telling you definitively if the operation was successful or failed. This is better than just looking at the transaction list.

**What's the difference between get_normal_transactions and get_internal_transactions?**
`get_normal_transactions` shows top-level, visible transactions. `get_internal_transactions` dives deeper, showing the function calls that happen *inside* a contract during a transaction, which is crucial for debugging complex logic.

**Can I get the ABI and source code at the same time?**
No. You run `get_contract_abi` to get the function list (the blueprint), and then you use `get_contract_source_code` separately to get the raw Solidity text. They are two distinct data types.

**What if I need to check balances for 20 different addresses?**
Don't call `get_glmr_balance` twenty times. Use `get_glmr_balance_multi`. This tool accepts a list of multiple addresses, giving you all the required balances in one go.

**When calling `get_glmr_balance`, what API key format is required for authentication?**
You must provide your Moonscan API Key in the request header. The server validates this key immediately, ensuring that your AI client has authorized access to query the data and tracks usage against potential rate limits.

**If I use `get_erc20_transfers` repeatedly for a large batch of addresses, how do I manage rate limits?**
The server implements standard rate limiting. If your AI client exceeds the allowed requests per window, it must pause execution and retry using an exponential backoff strategy to prevent service interruption.

**How do I filter specific event types when calling `get_logs`?**
You pass structured filters—specifically a Topic ID and a Filter Value—as arguments to the `get_logs` tool. This mechanism limits the output, allowing you to isolate only the contract events you care about.

**When should I use the `proxy_eth_get_transaction_by_hash` tool instead of checking normal transactions?**
Use this proxy when your client needs raw, low-level Ethereum Virtual Machine (EVM) data or specific state transitions that aren't exposed by the standard transaction history tools. It gives maximum access.

**Can I check the GLMR balance of multiple wallets in a single request?**
Yes! Use the `get_glmr_balance_multi` tool and provide a comma-separated list of addresses to get all balances at once.

**How do I view the verified source code of a Moonbeam smart contract?**
Simply use the `get_contract_source_code` tool with the contract address. If the contract is verified on Moonscan, the agent will retrieve the source code for you.

**Is it possible to track NFT movements for a specific address?**
Yes, you can use `get_erc721_transfers` for standard NFTs or `get_erc1155_transfers` for multi-token standards to see all recent transfer events.