# SolanaFM MCP

> SolanaFM (Solana FM Block Explorer API) gives your AI agent direct access to Solana blockchain data. You inspect blocks, transactions by signature or range, account metadata, and token balances—all without leaving your IDE. It turns complex web explorer searches into simple conversation prompts.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** solana, block-explorer, web3, blockchain-data, crypto-analysis

## Description

**SolanaFM gives your agent straight access to Solana's ledger data. Forget clicking through a dozen tabs on some bloated web explorer; you just tell your AI client what you need and it pulls the raw, verifiable JSON payload.**

You’re checking out blocks, transactions by signature or range, account metadata, and token balances—all without ever leaving your IDE. It turns those deep-dive crypto searches into simple conversation prompts. You get granular control over the entire Solana stack.

**Account State and Ownership Details:**
When you need to know what an account *is*, you use `get_account_info`. This function fetches the current metadata record and the precise state data for any given Solana address, telling you exactly who owns it. If you’re tracking token holdings, you'll rely on `get_token_accounts`, which returns every single individual token account attached to a specific wallet, listing both the mint details and their corresponding balances.

**Tracking Activity Across Addresses:**
To see what an address has been up to, you can use `get_account_transactions`. This compiles a complete list of all transaction signatures that have ever run against that specified wallet address. If you need more than just the signature—if you wanna know exactly what happened in one specific transfer or interaction—you pull the full payload using `get_transaction` by its unique signature string.

**Deep Ledger Analysis (Blocks):**
Analyzing the ledger itself requires knowing how to handle time and slots. You can fetch data for a single, specified block slot number using `get_block`, which gives you all the content and validator info for that exact moment in time. If you need to look at a big chunk of history—say, everything from Slot 100 through Slot 500—you use `get_blocks`. This function fetches an entire array of block data covering your defined start-to-end slot range.

**How It Works:**
Your agent doesn't guess; it executes. You don't write complex RPC calls or filter JSON manually. You simply tell your client, 'Check the metadata for this address,' and it runs `get_account_info`. If you need to count token holdings, you prompt for that, and it uses `get_token_accounts` to return a list of mints and balances for every account linked to that wallet.

It’s all about precision. You wanna see the full payload details? Use `get_transaction`. Wanna see everything attached to an address's history? Call `get_account_transactions`. If you need to compare accounts, you get their current state via `get_account_info` and then check their token holdings using `get_token_accounts`. You can’t mess around with this data; it’s raw blockchain truth. The system makes the complex web explorer search—the kind that takes like ten clicks just to verify ownership—into a single conversation prompt.

## Tools

### get_account_info
Fetches the current metadata and state of any given Solana account.

### get_account_transactions
Lists all transaction signatures linked to a specific wallet address.

### get_block
Retrieves detailed data for one single, specified block slot number.

### get_blocks
Fetches an array of blocks covering a defined range of slot numbers.

### get_token_accounts
Returns all token accounts owned by a specific wallet address, listing their mints and balances.

### get_transaction
Retrieves the full payload details for one unique transaction signature.

## Prompt Examples

**Prompt:** 
```
Get the details for Solana block at slot 250000000.
```

**Response:** 
```
I've retrieved the details for block 250000000. It contains 2,450 transactions and was produced by validator 'Chorus One'. Would you like to see the list of transaction signatures in this block?
```

**Prompt:** 
```
Show me all token accounts owned by 7xKX... (address).
```

**Response:** 
```
Analyzing the wallet... I found 3 token accounts for this address: 500 USDC, 1.5 SOL, and 10,000 BONK. Do you need the specific mint addresses for these tokens?
```

**Prompt:** 
```
List the last transactions for account address 7xKX... (address).
```

**Response:** 
```
I've fetched the recent transaction history. There are 5 recent activities, including a 'Transfer' of 2 SOL and a 'Swap' on Jupiter. Would you like the full details for the most recent transaction signature?
```

## Capabilities

### Determine account metadata and ownership
The agent retrieves current state data, including the full metadata record, for a specific Solana account.

### List all associated transactions for an address
The system compiles a list of transaction signatures that have ever run against a specified wallet address.

### Fetch details for a single block slot
You retrieve the full content and validator information for one specific, known block slot number.

### Bulk fetch multiple blocks by range
The agent fetches an array of block data covering a defined starting slot through an ending slot number.

### Count and identify token holdings
This tool lists every individual token account held under a specific wallet address, along with their mint details.

### Get full transaction payload by signature
The agent fetches the complete, detailed data for one single transaction using its unique signature string.

## Use Cases

### Investigating a failed transfer
A user sees an unexpected zero balance. They ask their agent to run `get_account_info`. The agent reports the current state, but the balance is wrong. The user then calls `get_transaction` on the most recent signature to see exactly which input/output contract failed.

### Auditing a smart wallet's holdings
A researcher needs to know if a whale's portfolio is diversified. They first run `get_token_accounts` on the address, getting a list of all assets and their amounts. Next, they use `get_account_transactions` to see when those tokens arrived.

### Debugging smart contract deployment
A developer needs to confirm the exact data stored in a new block range. They start by running `get_blocks` for the time window. Then they use `get_account_info` on the target contract address to verify its final metadata.

### Building an economic report
A data analyst needs historical volume metrics. They ask their agent to run `get_blocks` across Q3 slot ranges, pulling together block context and then aggregating the transaction counts from `get_account_transactions`.

## Benefits

- See the full state of an account instantly with `get_account_info`. You don't have to click through multiple tabs just to verify if a contract still exists or who owns it.
- Track all token movements at once. Instead of manually listing every asset, use `get_token_accounts` to get a clean count and list of assets for any wallet.
- Analyze transaction history without limits. Use `get_account_transactions` to pull the last 50 activities on an address in one go, perfect for auditing.
- Debug transactions rapidly. If you have a signature, running `get_transaction` gives you the entire payload—the inputs and outputs—immediately.
- Audit large time periods easily. Use `get_blocks` to get data across a range of slot numbers, letting your agent analyze market conditions over hours or days.
- Understand block context. With `get_block`, you can determine which validator produced the block and how many transactions were processed in that specific slot.

## How It Works

The bottom line is: your AI client acts as a blockchain analyst, running specific queries instead of browsing web pages.

1. Subscribe to this server and enter your SolanaFM API Key. This authenticates access to the blockchain index.
2. Your AI client issues a natural language query (e.g., 'What tokens does wallet X own?').
3. The agent translates that into a tool call (e.g., `get_token_accounts`) and receives structured JSON data describing the account's state.

## Frequently Asked Questions

**How do I get the total number of tokens owned by an address using get_token_accounts?**
The `get_token_accounts` tool lists all token accounts and their individual balances. Your agent processes this list to provide you with a summary count, ensuring you don't miss any assets.

**Can I check the details of a block using get_block if I only have the time?**
No, `get_block` requires the specific slot number. You must first find the correct slot range and then use `get_blocks` to narrow down the exact block you need.

**What's the difference between get_account_transactions and get_token_accounts?**
They track different things. `get_account_transactions` lists *every* transaction signature ever run on an address (the action). `get_token_accounts` only shows the current list of tokens held by that address (the state).

**Do I need to use get_transaction every time I check a transfer?**
No. While `get_transaction` provides the full payload for one signature, often listing transactions with `get_account_transactions` gives you enough context unless you need deep debugging.

**What do I need to know about authentication when using get_account_info?**
You must include your unique SolanaFM API key in the request header for all calls. The server validates this key before running any queries, so make sure it's active and correctly formatted.

**If I need to check a large range of blocks, are there limits when using get_blocks?**
Yes, the API enforces rate limits and time window constraints for bulk requests. For optimal performance with get_blocks, break your queries into smaller, sequential batches rather than requesting huge ranges all at once.

**Does get_account_info return just metadata, or does it include the current on-chain state of an account?**
It provides both. The function returns structured metadata (like owner and program ID) alongside the account's most recent recorded data state, which includes balances if applicable.

**Is there a better way to check transaction history for multiple addresses than calling get_account_transactions repeatedly?**
While you can call get_account_transactions many times, the best practice is often to group your target addresses and query them in parallel batches. This significantly reduces latency when analyzing large sets of accounts.

**How can I inspect the transaction history for a specific Solana wallet address?**
Use the `get_account_transactions` tool by providing the Solana account address. The agent will return a list of transactions associated with that specific wallet.

**Can I see all the tokens held by a specific account?**
Yes! The `get_token_accounts` tool retrieves all token accounts owned by a target wallet address, allowing you to see balances and token types.

**How do I get detailed information about a specific block on the Solana network?**
Simply use the `get_block` tool with the specific slot number. For a range of blocks, you can use the `get_blocks` tool with start and end slot numbers.