search_in_names
Locate specific names or symbols in a binary file using customizable search parameters, including pattern matching and case sensitivity, to streamline reverse engineering tasks in IDA Pro.
Instructions
Search for names/symbols in the binary
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caseSensitive | No | Whether the search is case sensitive (default: false) | |
| pattern | Yes | Pattern to search for in names | |
| type | No | Type of names to search for (function, data, import, export, label, all) |
Implementation Reference
- index.ts:743-778 (handler)MCP tool handler for 'search_in_names': validates input using isValidSearchInNamesArgs, calls ida.searchInNames with pattern and options, formats and returns the search results as text content.case 'search_in_names': if (!isValidSearchInNamesArgs(request.params.arguments)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid search in names arguments' ); } try { const { pattern, caseSensitive, type } = request.params.arguments; const result = await ida.searchInNames(pattern, { caseSensitive, type: type as 'function' | 'data' | 'import' | 'export' | 'label' | 'all' }); return { content: [ { type: 'text', text: `Found ${result.count} names matching "${pattern}":\n\n${JSON.stringify(result.results, null, 2) }`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error searching in names: ${error.message || error}`, }, ], isError: true, }; }
- index.ts:350-370 (registration)Registration of the 'search_in_names' tool in the listTools response, including name, description, and input schema definition.{ name: 'search_in_names', description: 'Search for names/symbols in the binary', inputSchema: { type: 'object', properties: { pattern: { type: 'string', description: 'Pattern to search for in names', }, caseSensitive: { type: 'boolean', description: 'Whether the search is case sensitive (default: false)', }, type: { type: 'string', description: 'Type of names to search for (function, data, import, export, label, all)', }, }, required: ['pattern'], },
- index.ts:61-65 (schema)TypeScript interface defining the input arguments for search_in_names tool.interface SearchInNamesArgs { pattern: string; caseSensitive?: boolean; type?: 'function' | 'data' | 'import' | 'export' | 'label' | 'all'; }
- index.ts:129-135 (helper)Validator function to check if arguments match SearchInNamesArgs type, used in the tool handler.const isValidSearchInNamesArgs = (args: any): args is SearchInNamesArgs => { return ( typeof args === 'object' && args !== null && typeof args.pattern === 'string' ); };
- idaremoteclient.ts:445-464 (helper)Core implementation of searchInNames in IDARemoteClient: constructs query parameters and makes HTTP GET request to /search/names endpoint.async searchInNames( pattern: string, options: { caseSensitive?: boolean; type?: 'function' | 'data' | 'import' | 'export' | 'label' | 'all'; } = {} ): Promise<NameSearchResponse> { const params = new URLSearchParams(); params.append('pattern', pattern); if (options.caseSensitive !== undefined) { params.append('case_sensitive', options.caseSensitive.toString()); } if (options.type !== undefined) { params.append('type', options.type); } return this.get<NameSearchResponse>(`/search/names?${params.toString()}`); }