Skip to main content
Glama

search_immediate_value

Find specific numeric or string values within a binary file during reverse engineering analysis in IDA Pro.

Instructions

Search for immediate values in the binary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYesValue to search for (number or string)
radixNoRadix for number conversion (default: 16)
startAddressNoStart address for search (optional)
endAddressNoEnd address for search (optional)

Implementation Reference

  • MCP server handler for the 'search_immediate_value' tool. Validates input arguments and delegates execution to IDARemoteClient.searchForImmediateValue, then formats and returns the results.
    case 'search_immediate_value':
        if (!isValidSearchImmediateValueArgs(request.params.arguments)) {
            throw new McpError(
                ErrorCode.InvalidParams,
                'Invalid search immediate value arguments'
            );
        }
    
        try {
            const { value, radix, startAddress, endAddress } = request.params.arguments;
    
            const result = await ida.searchForImmediateValue(value, {
                radix,
                startAddress,
                endAddress
            });
    
            return {
                content: [
                    {
                        type: 'text',
                        text: `Found ${result.count} occurrences of immediate value ${value}:\n\n${JSON.stringify(result.results, null, 2)
                            }`,
                    },
                ],
            };
        } catch (error: any) {
            return {
                content: [
                    {
                        type: 'text',
                        text: `Error searching for immediate value: ${error.message || error}`,
                    },
                ],
                isError: true,
            };
        }
  • Core implementation of immediate value search. Constructs query parameters and makes HTTP GET request to IDA Pro remote API endpoint '/search/immediate'.
    async searchForImmediateValue(
        value: number | string,
        options: {
            radix?: number;
            startAddress?: number | string;
            endAddress?: number | string;
        } = {}
    ): Promise<ImmediateSearchResponse> {
        const params = new URLSearchParams();
        params.append('value', value.toString());
        
        if (options.radix !== undefined) {
            params.append('radix', options.radix.toString());
        }
        
        if (options.startAddress !== undefined) {
            const startAddr = typeof options.startAddress === 'string'
                ? options.startAddress
                : options.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);
        }
        
        return this.get<ImmediateSearchResponse>(`/search/immediate?${params.toString()}`);
    }
  • index.ts:236-261 (registration)
    Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema for 'search_immediate_value'.
    {
        name: 'search_immediate_value',
        description: 'Search for immediate values in the binary',
        inputSchema: {
            type: 'object',
            properties: {
                value: {
                    type: 'string',
                    description: 'Value to search for (number or string)',
                },
                radix: {
                    type: 'number',
                    description: 'Radix for number conversion (default: 16)',
                },
                startAddress: {
                    type: 'string',
                    description: 'Start address for search (optional)',
                },
                endAddress: {
                    type: 'string',
                    description: 'End address for search (optional)',
                },
            },
            required: ['value'],
        },
    },
  • TypeScript interface defining the input arguments for the search_immediate_value tool, used for runtime validation.
    interface SearchImmediateValueArgs {
        value: string | number;
        radix?: number;
        startAddress?: string | number;
        endAddress?: string | number;
    }
  • Runtime validation function for SearchImmediateValueArgs type, ensuring required 'value' field is present and of correct type.
    const isValidSearchImmediateValueArgs = (args: any): args is SearchImmediateValueArgs => {
        return (
            typeof args === 'object' &&
            args !== null &&
            (typeof args.value === 'string' || typeof args.value === 'number')
        );
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral information. It doesn't disclose whether this is a read-only operation, what permissions might be needed, how results are returned, or any performance characteristics. The description only states what the tool does at a high level.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that gets straight to the point without any wasted words. It's appropriately sized for what it communicates and is front-loaded with the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with 4 parameters and no annotations or output schema, the description is insufficient. It doesn't explain what constitutes an 'immediate value' in binary analysis, how results are formatted, whether there are limitations on search scope, or how this differs from other search tools on the server.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. The baseline of 3 is appropriate when the schema does the heavy lifting for parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search for') and target ('immediate values in the binary'), which distinguishes it from siblings like search_byte_sequence or search_text. However, it doesn't fully explain what 'immediate values' means in this context compared to other search tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like search_byte_sequence or search_text. There's no mention of specific use cases, prerequisites, or limitations that would help an agent choose between similar search tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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