get_functions
Extract a list of functions from a binary file using IDA Pro integration, enabling streamlined reverse engineering and analysis workflows.
Instructions
Get list of functions from the binary
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.ts:647-677 (handler)MCP tool handler for 'get_functions': validates input arguments using isValidGetFunctionsArgs, calls ida.getFunctions() to retrieve functions from IDA Pro, formats the response as text content with JSON stringified functions list, handles errors.case 'get_functions': if (!isValidGetFunctionsArgs(request.params.arguments)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid get functions arguments' ); } try { const result = await ida.getFunctions(); return { content: [ { type: 'text', text: `Retrieved ${result.count} functions from the binary:\n\n${JSON.stringify(result.functions, null, 2) }`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error getting functions: ${error.message || error}`, }, ], isError: true, }; }
- idaremoteclient.ts:322-328 (handler)Delegated handler implementation in IDARemoteClient: performs HTTP GET request to IDA Pro remote API endpoint '/functions' to fetch the list of functions./** * Get functions from the binary * @returns List of functions in the binary */ async getFunctions(): Promise<FunctionsResponse> { return this.get<FunctionsResponse>('/functions'); }
- index.ts:77-79 (schema)TypeScript interface defining the input schema for get_functions tool arguments (no required parameters).interface GetFunctionsArgs { // No parameters required }
- index.ts:333-340 (registration)Tool registration in the ListTools response: defines name 'get_functions', description, and empty input schema.name: 'get_functions', description: 'Get list of functions from the binary', inputSchema: { type: 'object', properties: {}, required: [], }, },
- index.ts:153-158 (helper)Helper function to validate if provided arguments match the GetFunctionsArgs type (accepts any non-null object).const isValidGetFunctionsArgs = (args: any): args is GetFunctionsArgs => { return ( typeof args === 'object' && args !== null ); };