- LOGS
- TRACE
- CONTEXT
- HUMAN
Short answer
How can I use AI to debug Near smart contract transactions?
Your AI uses Nearblocks to pull specific transaction details, block data, and account histories. This lets you ask your agent to find error logs or trace the sequence of events that led to a failed contract call.
Debugging outcomes
Where your technical data lands.
The AI organizes raw blockchain data into clear answers.
LOGS
Error identification
The AI pulls specific transaction details to find the exact reason a smart contract call failed. You get the specific error message instead of a generic failure status.
TRACE
Event sequencing
By looking at account transactions, your agent maps out the history of a specific address. This helps you see exactly what happened before a bug occurred.
CONTEXT
Block-level data
The AI pulls block details to provide the surrounding context of a transaction. This is useful for checking gas usage or block-wide state changes.
HUMAN
Code fixes
The AI identifies the failure point in the data, but you must write the actual smart contract fix. It provides the evidence, you provide the solution.
The workflow
What your AI does when a transaction fails.
The AI acts as a bridge between the Near blockchain and your chat interface.
Fetch transaction data
The AI pulls the specific payload and receipt for a transaction hash to see the exact input and output.
get_transaction_detailsAudit account history
Your agent scans the recent activity of a specific account to find related calls or state changes.
get_account_transactionsExamine block state
The AI looks at the block containing the transaction to verify the state of the network at that time.
get_block_detailsSynthesize errors
The AI combines the retrieved data to explain why a contract call reverted or failed.
get_transaction_details
Try it
Copy these to start.
Use these prompts to begin your investigation.
Starting points
Swap the transaction hashes or account IDs for your actual data.
Nearblocks Connector
You're all set. Choose your MCP client and follow the setup instructions.
https://edge.vinkius.com/vk_preview_mOUL1cNTLhJp3GHXcAMiXlep5sQxPYyaaX4igpsB/mcpClaude Desktop
Follow the steps below to connect in seconds.
- 1In Claude Desktop, open Settings → Connectors.
- 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
- 3Click Add and start a new chat — Nearblocks capabilities are ready to use.
{
"mcpServers": {
"nearblocks-near-blockchain-explorer-api-mcp": {
"url": "https://edge.vinkius.com/vk_preview_mOUL1cNTLhJp3GHXcAMiXlep5sQxPYyaaX4igpsB/mcp"
}
}
}Look up the details for transaction 0x123... and tell me why the contract call failed.
Get the last 10 transactions for account near-account-name to see if they were successful.
Check the details for block 54321 to see the transaction count.
Analyze the transaction 0xabc... and explain the input data used in the smart contract call.
Claude
ChatGPT
Cursor
VS Code
Windsurf
Claude Code
JetBrains
Cline
Start here
Connect Nearblocks once, then ask.
One click connects the Nearblocks MCP to your client. Your credentials stay encrypted, and you can start debugging immediately.
Connect Nearblocks to your AIFAQ
How the debugging process works
- 01
Can the AI fix my smart contract bugs?
No. The AI can only read the transaction data and explain why it failed. You have to write and deploy the code fix yourself.
- 02
Can the AI send transactions on the Near network?
No. This MCP is read-only. It can only pull data from the blockchain using Nearblocks; it cannot sign or broadcast new transactions.
- 03
How does the AI see failed calls?
It uses the transaction details tool to pull the specific error logs and receipt data from the blockchain.
- 04
Does the AI have access to my private keys?
No. The AI only accesses public on-chain data through the Nearblocks API. It never needs or touches your private keys.
- 05
Can I use this to track a specific user's history?
Yes. You can ask the AI to pull the transaction history for any specific account address.
More questions about Nearblocks? See everything the Nearblocks Connector can do
Connect Nearblocks to Claude, Cursor, ChatGPT & more
