Skip to main content
Glama

execute_script

Execute custom Python scripts within IDA Pro to automate reverse engineering tasks, analyze binary data, and modify the database using IDAPython modules.

Instructions

Execute arbitrary IDAPython code in the IDA environment.

The code has access to all IDA modules (idaapi, ida_funcs, ida_bytes, etc.).
Use 'result' variable to return a value from the script.

WARNING: This is a powerful tool - use with caution as it can modify the database.

Example:
    code = '''
    # Count functions with more than 100 instructions
    count = 0
    for func_ea in idautils.Functions():
        func = ida_funcs.get_func(func_ea)
        if func and func.end_ea - func.start_ea > 100:
            count += 1
    result = f"Found {count} large functions"
    '''

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython code to execute in the IDA environment
timeout_secondsNoMaximum execution time in seconds (default: 30)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorYes
outputYes
successYes
return_valueYes
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: the code's access to IDA modules, the use of a 'result' variable for returns, and a warning about database modification and power. This covers safety, output mechanism, and environmental context beyond basic execution.

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?

The description is appropriately sized and front-loaded, starting with the core purpose, followed by access details, return mechanism, warning, and an example. Each sentence adds value without redundancy, and the structure guides the user from general to specific information efficiently.

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

Completeness5/5

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

Given the tool's complexity (arbitrary code execution with database modification risk), no annotations, and an output schema present, the description is complete. It covers purpose, behavior, warnings, and provides an example, addressing the need for guidance without repeating structured data. The output schema handles return values, so no additional explanation is required.

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 description coverage is 100%, so the schema already documents both parameters ('code' and 'timeout_seconds'). The description adds minimal param-specific semantics, only implying code execution through the example. It does not provide additional syntax or format details beyond what the schema offers, meeting the baseline for high coverage.

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?

The description clearly states the tool's purpose as 'Execute arbitrary IDAPython code in the IDA environment,' specifying both the action (execute) and resource (IDAPython code). It distinguishes itself from sibling tools by emphasizing arbitrary code execution capability, unlike more specific tools like 'decompile_function' or 'rename_function.'

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?

The description provides clear context for usage by mentioning access to IDA modules and a warning about database modification, but it does not explicitly state when to use this tool versus alternatives. It implies usage for custom operations not covered by other tools, though no direct comparisons or exclusions are made.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/icryo/ida-pro-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server