• TRACE
  • LOGS
  • REASON
  • HUMAN

How to debug failed smart contract transactions with your AI

Connect Metisscan to your agent to pull execution data from the Metis L2 network. Once connected, your AI can scan logs and trace calls to find exactly where a contract failed.

Ask AI about this page

Short answer

How can I debug failed Metis transactions with AI?

Your agent uses Metisscan to pull transaction receipts, internal calls, and event logs. It then analyzes the trace to find the specific revert reason or failed state change. You get a clear breakdown of the execution path and the root cause.

Debugging outcomes.

Where your findings land.

The AI processes raw blockchain data into specific technical insights.

TRACE

Internal call mapping

The AI follows the execution path through every nested call. You see exactly which sub-contract triggered the failure.

LOGS

Event log analysis

Your agent pulls all emitted events to check if state changes happened before the crash. This helps identify missing or incorrect events.

REASON

Root cause identification

The AI compares the transaction receipt against the expected logic. It tells you if the failure was a gas issue, a revert, or a logic error.

HUMAN

Manual fix required

The AI identifies the bug but cannot rewrite your contract. You must take the findings to your development environment to apply the fix.

The workflow

What your AI does when a transaction fails.

The agent moves from high-level receipt data to deep execution traces.

  1. Fetch receipt

    The agent grabs the basic transaction status and gas usage to confirm the failure.

    eth_get_transaction_receipt
  2. Trace internals

    It digs into the nested calls to see which specific contract instruction failed.

    get_transaction_internal_transactions
  3. Inspect logs

    The agent scans all emitted logs to see the state of the system at the time of failure.

    get_transaction_logs
  4. Simulate state

    It runs a dry run of the call to see how the contract would behave with different inputs.

    eth_call

Try it

Copy these to start.

Use these prompts to begin your debugging session.

Starting points

Swap out the transaction hashes and contract addresses with your actual data.

Metisscan Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_zyQr84ZqWsm75UyKe8SMUHe3tqoUUbpiQAh6jf7t/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Metisscan capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "metisscan-metis-l2-network-explorer-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_zyQr84ZqWsm75UyKe8SMUHe3tqoUUbpiQAh6jf7t/mcp"
    }
  }
}
Copy into chat04
  • Analyze this Metis transaction hash 0x123... and tell me why it reverted.

  • Trace the internal calls for transaction 0xabc... to find the failing sub-contract.

  • Check the event logs for this transaction 0xdef... to see if the transfer event was emitted.

  • Run a simulation for this contract call 0x789... to see if it succeeds with different parameters.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Metisscan once, then ask.

Just link your Metisscan credentials to the MCP. Your agent will immediately have access to the Metis L2 data needed to start debugging.

Connect Metisscan to your AI

FAQ

How the debugging process works

  • 01

    Can the AI fix my smart contract automatically?

    No. The AI only reads data and identifies the error. You have to write and deploy the fix yourself.

  • 02

    Can the AI execute new transactions on Metis?

    No. This MCP is for reading transaction data and logs. It does not have tools to sign or send transactions.

  • 03

    Does the AI see my private keys?

    No. The connection is read-only for blockchain data. Your keys are never exposed to the agent or the MCP.

  • 04

    What happens if the transaction is very complex?

    The agent uses internal transaction tracing to follow every step, making it capable of handling deep call stacks.

  • 05

    Can I use this with any AI client?

    Yes, as long as you are using an MCP-compatible client like Claude, Cursor, or Windsurf.

  • More questions about Metisscan? The Connector page answers them. See everything the Metisscan Connector can do

Connect Metisscan to Claude, Cursor, ChatGPT & more