Skip to main content
Glama

get_disassembly

Retrieve disassembled code for a specific address range in IDA Pro to analyze binary instructions and understand program behavior during reverse engineering.

Instructions

Get disassembly for an address range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startAddressYesStart address for disassembly
endAddressNoEnd address for disassembly (optional)
countNoNumber of instructions to disassemble (optional)

Implementation Reference

  • MCP CallToolRequestSchema handler case for 'get_disassembly' tool: validates input arguments, calls the IDA remote client to get disassembly, formats and returns the response or error.
    case 'get_disassembly':
        if (!isValidGetDisassemblyArgs(request.params.arguments)) {
            throw new McpError(
                ErrorCode.InvalidParams,
                'Invalid disassembly arguments'
            );
        }
    
        try {
            const { startAddress, endAddress, count } = request.params.arguments;
    
            if (startAddress && typeof startAddress == 'string') {
                startAddress.replace("00007", "0x7")
            }
            if (endAddress && typeof endAddress == 'string') {
                endAddress.replace("00007", "0x7")
            }
    
    
            const result = await ida.getDisassembly(startAddress, {
                endAddress,
                count
            });
    
            return {
                content: [
                    {
                        type: 'text',
                        text: `Disassembly from ${result.start_address}${result.end_address ? ` to ${result.end_address}` : ''}:\n\n${JSON.stringify(result.disassembly, null, 2)
                            }`,
                    },
                ],
            };
        } catch (error: any) {
            return {
                content: [
                    {
                        type: 'text',
                        text: `Error getting disassembly: ${error.message || error}`,
                    },
                ],
                isError: true,
            };
        }
  • Core implementation of disassembly retrieval: constructs query parameters and makes HTTP GET request to IDA Pro remote server's /disassembly endpoint.
    async getDisassembly(
        startAddress: number | string,
        options: {
            endAddress?: number | string;
            count?: number;
        } = {}
    ): Promise<DisassemblyResponse> {
        const params = new URLSearchParams();
        
        const startAddr = typeof startAddress === 'string'
            ? startAddress
            : startAddress.toString();
        params.append('start', startAddr);
        
        if (options.endAddress !== undefined) {
            const endAddr = typeof options.endAddress === 'string'
                ? options.endAddress
                : options.endAddress.toString();
            params.append('end', endAddr);
        }
        
        if (options.count !== undefined) {
            params.append('count', options.count.toString());
        }
        
        return this.get<DisassemblyResponse>(`/disassembly?${params.toString()}`);
    }
  • index.ts:310-331 (registration)
    Tool registration in ListToolsRequestSchema response: defines name 'get_disassembly', description, and JSON input schema.
    {
        name: 'get_disassembly',
        description: 'Get disassembly for an address range',
        inputSchema: {
            type: 'object',
            properties: {
                startAddress: {
                    type: 'string',
                    description: 'Start address for disassembly',
                },
                endAddress: {
                    type: 'string',
                    description: 'End address for disassembly (optional)',
                },
                count: {
                    type: 'number',
                    description: 'Number of instructions to disassemble (optional)',
                },
            },
            required: ['startAddress'],
        },
    },
  • TypeScript interface defining the input arguments for the get_disassembly tool.
    interface GetDisassemblyArgs {
        startAddress: string | number;
        endAddress?: string | number;
        count?: number;
    }
  • Type guard function to validate GetDisassemblyArgs input in the tool handler.
    const isValidGetDisassemblyArgs = (args: any): args is GetDisassemblyArgs => {
        return (
            typeof args === 'object' &&
            args !== null &&
            (typeof args.startAddress === 'string' || typeof args.startAddress === 'number')
        );
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'get' implies a read operation, it doesn't specify whether this requires specific permissions, what format the disassembly returns in (e.g., assembly text, structured data), potential limitations like maximum range size, or error conditions for invalid addresses. This leaves significant gaps for a tool that likely interacts with binary analysis systems.

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 a single, efficient sentence with zero wasted words. It's appropriately sized for a straightforward tool and front-loads the essential information without unnecessary elaboration.

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?

Given the complexity of binary analysis tools and the absence of both annotations and an output schema, the description is insufficient. It doesn't explain what the disassembly output looks like (critical for interpretation), any behavioral constraints, or how it fits with sibling tools. For a tool with three parameters in this domain, more context is needed.

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 input schema already documents all three parameters with their types and optionality. The description adds no additional meaning beyond implying address range usage, which is already covered by the parameter names and schema descriptions. This meets the baseline for high schema coverage.

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 verb 'get' and the resource 'disassembly for an address range', making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_functions' or 'get_strings' that also retrieve specific data types from the binary analysis context, leaving room for potential confusion about when to choose this tool over others.

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. With sibling tools like 'get_functions' and 'get_strings' available, there's no indication of whether this is for raw instruction retrieval versus higher-level analysis, or any prerequisites for its use in the binary analysis workflow.

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