Skip to main content
Glama

search_in_names

Search for names and symbols in binary files to identify functions, data, imports, exports, or labels during reverse engineering analysis.

Instructions

Search for names/symbols in the binary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesPattern to search for in names
caseSensitiveNoWhether the search is case sensitive (default: false)
typeNoType of names to search for (function, data, import, export, label, all)

Implementation Reference

  • MCP tool handler for 'search_in_names': validates input arguments, calls IDARemoteClient.searchInNames with pattern and options, formats and returns 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-371 (registration)
    Registration of the 'search_in_names' tool in the MCP server's listTools response, including name, description, and inputSchema 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'],
        },
    },
  • TypeScript interface defining the input arguments for the search_in_names tool.
    interface SearchInNamesArgs {
        pattern: string;
        caseSensitive?: boolean;
        type?: 'function' | 'data' | 'import' | 'export' | 'label' | 'all';
    }
  • IDARemoteClient helper method that implements the name search by making an HTTP GET request to the IDA Pro Remote Control server's /search/names endpoint with query parameters for pattern, case sensitivity, and type.
    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()}`);
    }
  • Type guard function for validating SearchInNamesArgs input in the tool handler.
    const isValidSearchInNamesArgs = (args: any): args is SearchInNamesArgs => {
        return (
            typeof args === 'object' &&
            args !== null &&
            typeof args.pattern === 'string'
        );
    };

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