Skip to main content
Glama

Set an instruction operand type

set_op_type

Set an IDA instruction operand's type to struct offset, pointer, stack variable, or numeric format, fixing awkward decompiler expressions.

Instructions

Set the type of an instruction operand. GUI 'Y' / 'O' / '#' equivalent.

Tags an operand at a specific instruction with a desired interpretation. Useful when the decompiler picks an awkward expression form (e.g., the "earlier-named-symbol + offset" form for contiguous globals).

kind values:

  • "stroff": struct-offset reference. Requires struct, optional delta.

  • "offset": absolute offset / pointer. Optional target_addr.

  • "hex" | "dec" | "char" | "binary" | "octal": numeric format.

  • "stkvar": stack-variable reference (function-local).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesOperand-typing ops. Equivalent to GUI 'Y' (struct offset) or 'O' (offset) operations.
instance_idNoOptional database instance id. If omitted, use the current target.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv20261008.0.1

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the mutation semantics ('Tags an operand') and the per-kind interpretation, but says nothing about permissions, reversibility, or how the change interacts with existing analysis/undo.

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

Conciseness4/5

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

The single-line purpose is front-loaded, followed by a useful usage note and a scannable bullet list of kind semantics. Slightly long but every part earns its place; no redundant restatement.

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

Completeness4/5

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

An output schema exists, so return details are not needed, and the kind/field mapping plus GUI equivalence covers the core decision. The batch-vs-single nature of the `items` parameter and failure behavior are only implicitly covered via the schema.

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

Parameters4/5

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

Schema coverage is 100% (baseline 3), but the description adds genuine meaning by enumerating the `kind` values and mapping which auxiliary fields each consumes ('stroff' requires struct, optional delta; 'offset' optional target_addr; numeric formats; 'stkvar'). This is more than the schema's bare string field conveys.

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?

States a specific verb and resource ('Set the type of an instruction operand') and grounds it in the GUI equivalents ('Y' / 'O' / '#'). It clearly targets operand-level typing, distinct from general type tools, though it does not explicitly name sibling set_type/declare_type to sharpen the boundary.

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

Usage Guidelines3/5

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

It gives a when-to-use cue ('Useful when the decompiler picks an awkward expression form... for contiguous globals'), which is real guidance. However it offers no explicit alternatives or when-not-to-use conditions, so routing among the many type-related siblings is left to inference.

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