Skip to main content
Glama

run_ida_command

Execute IDA Pro scripts to automate reverse engineering and binary analysis tasks through the IDA Pro MCP Server.

Instructions

Execute an IDA Pro Script (IdaPython, Version IDA 8.3)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesscript

Implementation Reference

  • MCP tool handler for 'run_ida_command': validates arguments using isValidRunIdaArgs, executes the IDA script via IDARemoteClient.executeScript, and returns formatted text response with output or error.
    case 'run_ida_command':
        if (!isValidRunIdaArgs(request.params.arguments)) {
            throw new McpError(
                ErrorCode.InvalidParams,
                'Invalid run IDA command arguments'
            );
        }
    
        try {
            const { script } = request.params.arguments;
    
            let result = await ida.executeScript(script);
    
            if (result.error) {
                return {
                    content: [
                        {
                            type: 'text',
                            text: `Error executing IDA Pro script: ${result.error}`,
                        },
                    ],
                    isError: true,
                };
            }
    
            return {
                content: [
                    {
                        type: 'text',
                        text: `IDA Pro Script Execution Results:\n\n${result.output}`,
                    },
                ],
            };
    
    
        } catch (error: any) {
            return {
                content: [
                    {
                        type: 'text',
                        text: `Error executing IDA Pro command: ${error.message || error}`,
                    },
                ],
                isError: true,
            };
        }
  • index.ts:204-217 (registration)
    Registration of the 'run_ida_command' tool in the ListTools response, defining its name, description, and input schema requiring a 'script' string.
    {
        name: 'run_ida_command',
        description: 'Execute an IDA Pro Script (IdaPython, Version IDA 8.3)',
        inputSchema: {
            type: 'object',
            properties: {
                script: {
                    type: 'string',
                    description: 'script',
                }
            },
            required: ['script'],
        },
    },
  • TypeScript interfaces defining arguments for IDA command tools; RunIdaDirectCommandArgs matches 'run_ida_command' input with 'script' field.
    interface RunIdaCommandArgs {
        scriptPath: string;
        outputPath?: string;
    }
    interface RunIdaDirectCommandArgs {
        script: string;
    }
  • Runtime validation function for 'run_ida_command' arguments, checking for object with non-null 'script' string property.
    const isValidRunIdaArgs = (args: any): args is RunIdaDirectCommandArgs => {
        return (
            typeof args === 'object' &&
            args !== null &&
            (typeof args.script === 'string')
        );
    };
  • Core helper function called by the tool handler; sends the script via POST to IDA remote API '/execute' endpoint and returns ExecuteResponse.
    async executeScript(script: string, logHTTP = false): Promise<ExecuteResponse> {
    
        return this.post<ExecuteResponse>('/execute', { script });
    }
Behavior2/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 states the tool executes a script but doesn't describe execution context (e.g., sandboxed environment, permissions needed), potential side effects (e.g., modifying the IDA database), error handling, or output format. This leaves significant gaps for a tool that runs arbitrary code.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core action. It could be slightly improved by adding a brief usage note, but it avoids redundancy and wastes no words.

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

Completeness2/5

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

For a tool that executes arbitrary scripts with no annotations and no output schema, the description is incomplete. It lacks critical context such as execution environment, safety considerations, expected output, or error behavior, which are essential for an AI agent to use it correctly.

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?

The input schema has 100% description coverage, with the 'script' parameter documented as 'script'. The description adds no additional meaning about the parameter (e.g., syntax examples, supported libraries, or constraints). Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Execute') and the resource ('an IDA Pro Script'), specifying the scripting language (IdaPython) and version (IDA 8.3). However, it doesn't explicitly differentiate from its sibling 'run_ida_command_filebased', which likely handles script files rather than inline scripts.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'run_ida_command_filebased' or other analysis tools (e.g., 'get_functions', 'search_text'). There's no mention of prerequisites, typical use cases, or exclusions.

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/fdrechsler/mcp-server-idapro'

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