Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mrexodia/ida-pro-mcp/llms.txt

Use this file to discover all available pages before exploring further.

Stack frame tools operate on IDA’s function frame — the structured description of a function’s local storage. You can inspect every frame variable with its offset, type, and size; create new variables at specific offsets with explicit types; and delete variables that are no longer needed. These tools complement the rename and type operations available in the Modification and Type tools.
Stack frame variables are IDA frame members, distinct from Hex-Rays local variables (lvars). Renaming a frame member renames it in the disassembly view; renaming an lvar renames it in the decompiler view. Use rename with the stack key for frame members and local for decompiler variables.

stack_frame

Return the list of stack variables for one or more functions.
addrs
string | string[]
required
One or more function addresses or symbol names. Each address is resolved to the function that contains it.
Returns StackFrameResult[]
"0x401000"
Example response:
[
  {
    "addr": "0x401000",
    "vars": [
      { "name": "var_18", "offset": "-0x18", "size": "8",  "type": "qword" },
      { "name": "var_10", "offset": "-0x10", "size": "8",  "type": "qword" },
      { "name": "var_4",  "offset": "-0x4",  "size": "4",  "type": "dword" }
    ]
  }
]

declare_stack

Create a named, typed stack variable at a specific frame offset inside a function.
items
StackVarDecl | StackVarDecl[]
required
Returns StackMutationResult[]
Declare a typed local variable
{
  "addr": "0x401000",
  "offset": "-0x18",
  "name": "ctx",
  "ty": "Config *"
}
Use declare_type to register a custom struct before referencing it as a ty here. Any type already in IDA’s type library — including standard C types like uint32_t — can be used directly.

delete_stack

Delete a stack frame variable by name. The function’s frame is looked up automatically. Special frame members (such as saved registers and the return address) and argument slots cannot be deleted.
items
StackVarDelete | StackVarDelete[]
required
Returns StackMutationResult[]
Delete a stack variable
{
  "addr": "0x401000",
  "name": "var_4"
}

Example workflow

The following sequence inspects a function’s stack frame, renames an auto-generated variable, assigns it a concrete type, then verifies the result.
1

Inspect the stack frame

stack_frame call
"0x401000"
Response shows var_18 at offset -0x18 with type qword.
2

Rename the variable

Use rename with the stack key:
rename call
{
  "stack": {
    "func_addr": "0x401000",
    "old": "var_18",
    "new": "p_config"
  }
}
3

Apply a type

Use set_type with kind: "stack":
set_type call
{
  "addr": "0x401000",
  "name": "p_config",
  "ty": "Config *",
  "kind": "stack"
}
4

Verify

Call stack_frame again on 0x401000 to confirm p_config now appears with type Config *.

Build docs developers (and LLMs) love