Skip to main content
Glama

ida_exec

Runs arbitrary IDAPython in IDA Pro's kernel and returns captured stdout plus an optional result variable when dedicated tools cannot handle a task.

Instructions

Escape hatch: run arbitrary IDAPython inside the kernel and return captured stdout plus a 'result' variable if the script sets one. Use when no dedicated tool fits.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "ida_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations at all, the description carries the full burden; it discloses the output contract (stdout capture and optional 'result' variable), which is genuinely useful. However, it does not state that arbitrary kernel-level execution can mutate the IDB, that changes may be unsaved or irreversible, or anything about timeouts and failure modes — significant omissions for an unrestricted execution tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the defining label "Escape hatch" and then the return behavior and routing rule. No filler or restatement of the name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description correctly explains what comes back (stdout and an optional 'result'), which is the key missing piece an agent needs. What remains absent is error semantics and the state-mutation consequences of running arbitrary kernel code.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% for the single 'code' parameter, so the description must compensate: it implies 'code' is a Python script and that setting a variable named 'result' changes the return value, which adds real meaning. It still says nothing about whether the script runs in a specific namespace, what imports are available, or how errors surface.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Run arbitrary IDAPython inside the kernel" names a specific verb and resource, and the return contract (captured stdout plus a 'result' variable) is spelled out. The closing clause distinguishes it from every dedicated sibling, so an agent can identify its role without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Use when no dedicated tool fits" is an explicit fallback rule that tells the agent to prefer specialized tools like ida_decompile or ida_disasm first. It stops short of naming the specific alternative for any given task, but the negative condition is clear enough to route correctly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.