Skip to main content
Glama

get_disassembly

Retrieve disassembly for a specified address range in IDA Pro, enabling reverse engineering and binary analysis tasks with ease.

Instructions

Get disassembly for an address range

Input Schema

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

Implementation Reference

  • MCP tool handler for 'get_disassembly': validates arguments, calls IDARemoteClient.getDisassembly, formats and returns the disassembly response.
    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, }; }
  • index.ts:310-331 (registration)
    Tool registration in ListTools response, including name, description, and 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 input arguments for get_disassembly.
    interface GetDisassemblyArgs { startAddress: string | number; endAddress?: string | number; count?: number; }
  • Validator function for GetDisassemblyArgs input.
    const isValidGetDisassemblyArgs = (args: any): args is GetDisassemblyArgs => { return ( typeof args === 'object' && args !== null && (typeof args.startAddress === 'string' || typeof args.startAddress === 'number') ); };
  • IDARemoteClient.getDisassembly method: constructs API request to IDA Pro remote server /disassembly endpoint and returns disassembly response.
    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()}`); }

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