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.
Type tools give you programmatic access to IDA’s local type system. You can declare new structs, enums, and typedefs from C source strings, apply precise types to functions, globals, and local or stack variables, let Hex-Rays infer types automatically, and query the full type catalog with filtering and pagination.
Several tools — infer_types, set_type with kind: "local", and set_type with kind: "function" — require the Hex-Rays decompiler plugin. Operations on globals and stack variables work without it.
declare_type
Parse one or more C type declarations and register them in the IDB’s local type library.
decls
string | string[]
required
A C declaration string or a list of them. Standard C syntax is accepted, including struct, union, enum, typedef, and function pointer declarations. Semicolons are optional.
Returns DeclareTypeResult[]
Show DeclareTypeResult fields
The declaration string, echoed back.
Present only when parsing failed — includes parser messages.
Declare a struct
Declare multiple types
"struct Config { uint32_t flags; uint32_t version; char name[64]; };"
enum_upsert
Create a new enum or extend an existing one by upserting members. Existing members with matching name and value are skipped; conflicts are reported without modifying the enum.
queries
EnumUpsert | EnumUpsert[]
required
members
EnumMemberUpsert | EnumMemberUpsert[]
required
Members to create or verify. Show EnumMemberUpsert fields
Numeric value or a string parseable by int(x, 0).
Treat the enum as a bitfield (IDA BF_... style).
Returns EnumUpsertResult[]
Show EnumUpsertResult fields
true when the enum itself was newly created.
Members already present and matching.
Members that could not be added.
Top-level error or conflict summary.
{
"name" : "ErrorCode" ,
"members" : [
{ "name" : "ERR_OK" , "value" : 0 },
{ "name" : "ERR_INVALID" , "value" : 1 },
{ "name" : "ERR_TIMEOUT" , "value" : 2 }
]
}
set_type
Apply a type to a function, global variable, local decompiler variable, or stack frame variable. The kind field is inferred automatically in most cases.
edits
TypeEdit | TypeEdit[]
required
Address of the target (function start, global, or the function that owns the local/stack variable).
Type name or C declaration (e.g., "uint32_t *", "HANDLE", "int __cdecl(int, int)"). Aliases: type, decl, declaration.
Full function signature. When present, kind is inferred as "function".
Local variable name. When present, kind is inferred as "local".
Stack variable name (used when kind is "stack").
Explicit entity kind: function, global, local, or stack. Inferred when omitted.
Returns SetTypeResult[]
Show SetTypeResult fields
The input edit, echoed back.
Whether the type was applied.
Apply a function prototype
Apply a type to a global variable
Retype a local decompiler variable
Retype a stack frame variable
{
"addr" : "0x401000" ,
"signature" : "int __cdecl validate_serial(const char *input, size_t len)"
}
type_apply_batch
Apply multiple type edits with optional stop_on_error behavior and receive an aggregate result.
Show TypeApplyBatch fields
edits
TypeEdit | TypeEdit[]
required
List of type edits (same shape as set_type).
Abort on the first failure.
Returns TypeApplyBatchResult
Show TypeApplyBatchResult fields
true when no edits failed.
Successfully applied edits.
true when stop_on_error triggered early exit.
infer_types
Infer and apply likely types at the given addresses. Tries Hex-Rays inference first, then falls back to existing IDA type info, and finally uses item size as a last resort.
addrs
string | string[]
required
One or more addresses or symbol names to infer types for.
Returns InferTypeResult[]
Show InferTypeResult fields
The inferred type string, or null when inference failed.
hexrays, existing, size_based, or null.
Present only on exception.
Infer types at several addresses
[ "0x401000" , "0x404020" , "g_config" ]
read_struct
Read the field values of a struct instance from memory at a given address. The struct type can be specified explicitly or auto-detected from the type information already applied to the address.
queries
StructRead | StructRead[]
required
Address of the struct instance in the IDB.
Struct type name. When omitted, the type applied at the address is used.
Returns ReadStructResult[]
Show ReadStructResult fields
members
StructMemberValueResult[] | null
Per-field values read from memory. Show StructMemberValueResult fields
Hex offset within the struct.
Value read from memory, formatted for the type.
Read a Config struct at a known address
{
"addr" : "0x404020" ,
"struct" : "Config"
}
search_structs
Search the local type library for structs and unions whose names contain the given substring (case-insensitive).
Substring to search for in structure names.
Returns SearchStructResult[]
Show SearchStructResult fields
type_query
Query the full local type catalog with flexible filtering, sorting, and optional projection of member details and related types.
queries
TypeQuery | TypeQuery[]
required
Glob or regex pattern applied to type names.
Restrict to a specific kind: any, struct, union, enum, typedef, func, ptr, or udt.
Maximum results per page.
Sort by name, size, or ordinal.
Include the full declaration string.
Include UDT member layout.
Max members per UDT when include_members is true.
Include names of related types referenced by each type.
Returns TypeQueryResult[]
Show TypeQueryResult fields
The kind filter that was applied.
null when the last page has been reached.
Total matching types (before pagination).
List all structs, largest first
{
"kind" : "struct" ,
"sort_by" : "size" ,
"descending" : true ,
"include_members" : true
}
type_inspect
Inspect a single named type by exact name and retrieve its full declaration, size, kind flags, and optionally its member layout.
queries
TypeInspectQuery | TypeInspectQuery[]
required
Show TypeInspectQuery fields
Exact type name to inspect.
Include UDT member details.
Returns TypeInspectResult[]
Show TypeInspectResult fields
false when the type was not found.
Number of UDT members (0 for non-UDT types).
members
TypeCatalogMemberResult[] | null
Member layout when include_members is true.
Inspect a struct with its member layout
{
"name" : "Config" ,
"include_members" : true
}