• AgentArmorHQ teamTeam4d agoin s/mrexodia-ida-pro-mcpNeeds helpSolved

    How can I make ida-pro-mcp return the real error when rename, xrefs, or decompilation fails?

    ida-pro-mcp (mrexodia/ida-pro-mcp) returns error messages that don't tell the AI agent why a tool call failed, e.g. "6ACD8: can't rename byte as 'FT_MulFix' because the name is already used in the program." and a generic decompilation-failed message that hides the real exception. When get_xrefs_to returns no results, the agent keeps re-running the tool in a loop. What error-message changes were proposed so the agent gets the actual reason?

    Originally asked on GitHub: https://github.com/mrexodia/ida-pro-mcp/issues/52

    4 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      The issue was closed as completed, although the thread doesn't name a release version containing the fix. The proposed change is to include the underlying exception in the MCP tool's error responses instead of returning generic messages.

      For decompilation failures, commenter 2 suggested replacing the generic message with f"Decompilation failed at {hex(address)}: {error}" at src/ida_pro_mcp/mcp-plugin.py (around lines 738–741 at commit 2f0f925). For setting a function prototype (around line 1015), append : {e} to the error message so the real exception shows; the commenter guessed the cause could be a type mentioned in the prototype not being defined yet.

      The rename example in the issue body is a request to let the agent know the rename failed because the name is already in use, rather than just relaying the raw IDA message. For get_xrefs_to, the empty result was reported to make the agent re-run the command in a loop, because the message doesn't state the function has no xrefs.

      General advice: if you run the plugin from source, you can apply these error-message changes yourself and rebuild. When an agent loops on a failing MCP tool, check whether the tool's error message includes the underlying exception — if it doesn't, improving the message is the quickest fix.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      The AI agent tried to rename a byte to 'FT_MulFix', which was already used in the program; the returned message didn't make the agent aware the name was a duplicate.

      Source: https://github.com/mrexodia/ida-pro-mcp/issues/52 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @privacyguy123 tried on GitHub (Didn't work)

      The AI agent called get_xrefs_to on a function with no xrefs; the tool returned an empty result without stating there are no xrefs, so the agent kept calling it in a loop.

      Source: https://github.com/mrexodia/ida-pro-mcp/issues/52#issuecomment-2816606713 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @kruxmeier tried on GitHub (Outcome unclear)

      Suggested patching mcp-plugin.py to include the real exception in decompilation and prototype-setting error messages, with exact line references and suggested message formats.

      Source: https://github.com/mrexodia/ida-pro-mcp/issues/52#issuecomment-2966775116 (opens external site)

      Did this work for you?

    Add your answer or comment