Skip to main content
Glama

ida_rename_multi_functions

Rename multiple functions simultaneously in IDA Pro databases to streamline reverse engineering workflows and maintain consistent naming conventions.

Instructions

Rename multiple functions at once in the IDA database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rename_pairs_old2newYes

Implementation Reference

  • Pydantic schema/model for validating the tool input: list of old_name to new_name pairs.
    class RenameMultiFunctions(BaseModel):
        rename_pairs_old2new: List[Dict[str, str]]
  • MCP tool registration in list_tools() with name, description, and input schema.
    Tool(
        name=IDATools.RENAME_MULTI_FUNCTIONS,
        description="Rename multiple functions at once in the IDA database",
        inputSchema=RenameMultiFunctions.schema(), 
    ),
  • MCP server tool handler in call_tool(): calls ida_functions.rename_multi_functions() and returns result as text.
    case IDATools.RENAME_MULTI_FUNCTIONS:
        result: str = ida_functions.rename_multi_functions(
            arguments["rename_pairs_old2new"]
        )
        return [TextContent(
            type="text",
            text=result
        )]
  • Proxy handler in IDAProFunctions: sends 'rename_multi_functions' request to IDA plugin and formats response.
    def rename_multi_functions(self, rename_pairs_old2new: List[Dict[str, str]]) -> str:
        """Rename multiple functions at once"""
        try:
            response: Dict[str, Any] = self.communicator.send_request(
                "rename_multi_functions", 
                {"rename_pairs_old2new": rename_pairs_old2new}
            )
            
            if "error" in response:
                return f"Error renaming multiple functions: {response['error']}"
            
            success_count: int = response.get("success_count", 0)
            failed_pairs: List[Dict[str, str]] = response.get("failed_pairs", [])
            
            result_parts: List[str] = [
                f"Successfully renamed {success_count} functions"
            ]
            
            if failed_pairs:
                result_parts.append("\nFailed renamings:")
                for pair in failed_pairs:
                    result_parts.append(f"- {pair['old_name']} → {pair['new_name']}: {pair.get('error', 'Unknown error')}")
            
            return "\n".join(result_parts)
        except Exception as e:
            self.logger.error(f"Error renaming multiple functions: {str(e)}", exc_info=True)
            return f"Error renaming multiple functions: {str(e)}"
  • Core implementation: loops over rename pairs, calls single _rename_function_internal for each, reports success/fail counts.
    @idawrite
    def rename_multi_functions(self, rename_pairs_old2new: List[Dict[str, str]]) -> Dict[str, Any]:
        """Rename multiple functions at once"""
        try:
            success_count: int = 0
            failed_pairs: List[Dict[str, str]] = []
    
            for pair in rename_pairs_old2new:
                old_name = next(iter(pair.keys()))
                new_name = pair[old_name]
                
                # Call existing rename_function_internal for each pair
                result = self._rename_function_internal(old_name, new_name)
                
                if result.get("success", False):
                    success_count += 1
                else:
                    failed_pairs.append({
                        "old_name": old_name,
                        "new_name": new_name,
                        "error": result.get("message", "Unknown error")
                    })
    
            return {
                "success": True,
                "message": f"Renamed {success_count} out of {len(rename_pairs_old2new)} functions",
                "success_count": success_count,
                "failed_pairs": failed_pairs
            }
    
        except Exception as e:
            print(f"Error in rename_multi_functions: {str(e)}")
            traceback.print_exc()
            return {
                "success": False,
                "message": str(e),
                "success_count": 0,
                "failed_pairs": rename_pairs_old2new
            }
  • Helper: single function rename using ida_name.set_name() and refreshes view.
    def _rename_function_internal(self, old_name: str, new_name: str) -> Dict[str, Any]:
        """Internal implementation for rename_function without sync wrapper"""
        try:
            # Get function address
            func_addr: int = ida_name.get_name_ea(0, old_name)
            if func_addr == idaapi.BADADDR:
                return {"success": False, "message": f"Function '{old_name}' not found"}
            
            # Check if it's a function
            func: Optional[ida_funcs.func_t] = ida_funcs.get_func(func_addr)
            if not func:
                return {"success": False, "message": f"'{old_name}' is not a function"}
            
            # Check if new name is already in use
            if ida_name.get_name_ea(0, new_name) != idaapi.BADADDR:
                return {"success": False, "message": f"Name '{new_name}' is already in use"}
            
            # Try to rename
            if not ida_name.set_name(func_addr, new_name):
                return {"success": False, "message": f"Failed to rename function, possibly due to invalid name format or other IDA restrictions"}
            
            # Refresh view
            self._refresh_view_internal()
            
            return {"success": True, "message": f"Function renamed from '{old_name}' to '{new_name}' at address {hex(func_addr)}"}
        
        except Exception as e:
            print(f"Error renaming function: {str(e)}")
            traceback.print_exc()
            return {"success": False, "message": str(e)}
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 insight. It states the action is a rename operation (implying mutation) but doesn't disclose critical details like whether changes are reversible, permission requirements, error handling for invalid inputs, or effects on the IDA database state. This leaves significant gaps for a mutation tool.

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 a single, efficient sentence that directly states the tool's purpose without redundancy. It's appropriately sized for a straightforward operation, though its brevity contributes to gaps in other dimensions. Every word serves a clear function.

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?

Given the tool's mutation nature, lack of annotations, 0% schema coverage, and no output schema, the description is inadequate. It doesn't address behavioral risks, parameter usage, or expected outcomes, leaving the agent poorly equipped to use this tool correctly in the IDA database context.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain the structure of 'rename_pairs_old2new', the expected format of old/new names, validation rules, or examples. The agent must rely solely on the bare schema, which is insufficient for a complex array-of-objects parameter.

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 ('Rename multiple functions at once') and the target resource ('in the IDA database'), making the purpose understandable. It distinguishes from the single-function sibling 'ida_rename_function' by specifying 'multiple functions at once', but doesn't explicitly differentiate from other multi-rename tools like 'ida_rename_multi_global_variables' beyond the function focus.

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. It doesn't mention when batch renaming is preferred over the single-function 'ida_rename_function', nor does it explain prerequisites, constraints, or typical use cases. The agent must infer usage from the tool name alone.

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/MxIris-Reverse-Engineering/ida-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server