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') ); };

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