Skip to main content
Glama
I-CAN-hack
by I-CAN-hack

apply_types

Apply an existing datatype or array at a target address or label, clearing conflicting code/data if needed. Use with Ghidra projects to define data structures at specific locations.

Instructions

Apply an existing datatype, or an array of it, at an address or label.

The datatype must already exist in the selected program's datatype manager;
create it first with `set_types` when needed. `data_type` can be an exact
datatype name or full datatype path. It may also include a simple array
suffix such as `uds27_dispatch_entry[8]`; otherwise pass `count` to create
an array. When `clear_existing` is true, conflicting code/data units across
the target byte range are cleared before the new data is created.

Args:
    target: Address or exact label where the data should be created.
    data_type: Existing datatype name/path, optionally with `[count]`.
    program: Required Ghidra project path or name to target.
    count: Number of elements to apply. Use 1 for a single item.
    clear_existing: Clear conflicting code/data over the byte range first.
    timeout: Bridge execution timeout in seconds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
targetYes
programYes
timeoutNo
data_typeYes
clear_existingNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It clearly warns that setting clear_existing to true will clear conflicting code/data over the byte range before creating new data. It also mentions the timeout. However, it does not explicitly state the default value of clear_existing (true in the schema) or what happens if clear_existing is false and conflicts exist, which is a minor gap given the destructive potential.

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 front-loaded with a one-sentence purpose, then a concise paragraph on key behaviors, followed by a bulleted Args list. Every sentence adds value, no fluff. It is structured so an agent can quickly grasp the purpose and parameters.

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

Completeness5/5

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

The description covers prerequisites, parameter semantics, and the main side-effect (clearing). An output schema exists, so return-value documentation is not needed. For a tool with six parameters and a mutation side-effect, this is complete enough for an agent to call it correctly and safely.

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

Parameters5/5

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

Schema coverage is 0%, so the description must fully compensate. It explains each parameter in a dedicated Args section: target, data_type (including array suffix semantics), program, count, clear_existing, and timeout. It adds meaning beyond the schema titles, such as the array-suffix option and the clearing behavior, which are critical for correct invocation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear verb-resource-location statement: 'Apply an existing datatype, or an array of it, at an address or label.' It distinguishes itself from sibling set_types (which creates types) and get_types (retrieves) by focusing on application. This gives an agent an unambiguous purpose.

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

Usage Guidelines5/5

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

Explicitly states a prerequisite and a routing rule: 'The datatype must already exist in the selected program's datatype manager; create it first with set_types when needed.' It also explains when to use the array suffix vs. the count parameter. This is precise guidance on when and how to use the tool versus alternatives.

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