Skip to main content
Glama

Declare Stack

declare_stack

Create stack variables at specified offsets within IDA Pro functions using function address, offset, name, and optional type/size for reverse engineering.

Instructions

Create stack variable(s) at specified offset(s).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "items": "<items>"
    },
    "name": "declare_stack"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesList of {function_address, offset, name, type?, size?}
timeoutNoTimeout in seconds
instance_idNoREQUIRED whenever more than one database is open (from open_database's result or list_databases()); optional only while exactly one instance is live.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.1
    • changedInput schema / properties / instance_id / description
      Previous value: -"Instance id override"New value: +"REQUIRED whenever more than one database is open (from open_database's result or list_databases()); optional only while exactly one instance is live."
  2. First observedv0.9.7

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden and falls well short. It does not say what happens if a variable already exists at the given offset (overwrite, error, or merge), whether the operation is reversible, whether it needs prior analysis or a decompiler, or whether it persists to the IDB. 'Create' signals a mutation but nothing else.

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?

A single front-loaded sentence with no filler or redundancy. Its brevity is appropriate structurally, though it borders on under-specification rather than tightness.

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 an unannotated mutation tool with no output schema, the description omits what an agent most needs: conflict/overwrite behavior at an occupied offset, whether the created variable is returned, and any analysis prerequisite. The rich schema for items and instance_id covers parameter shape but not tool behavior, leaving the definition thin for a state-changing operation.

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%: items enumerates {function_address, offset, name, type?, size?} and instance_id documents its multi-database requirement. The description's phrase 'at specified offset(s)' merely echoes the offset field and adds no semantics beyond the schema, so the baseline of 3 applies.

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 (Create) and resource (stack variable(s)) with the scoping detail of specified offset(s), which is enough to know it declares stack-frame variables rather than editing code or data. It does not distinguish itself from nearby siblings like delete_stack, stack_frame, set_local_variable_type, or rename_local_variable, so an agent must infer 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 Guidelines2/5

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

There is no statement of when to use this versus delete_stack (removal), stack_frame (inspection), or set_local_variable_type (retyping an existing variable). No prerequisites, no mention that a database must be open or a function analyzed. The agent gets no routing guidance at all.

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