Skip to main content
Glama

set_type

Idempotent

Defines structs, enums, typedefs and prototypes, names fields, and applies types at addresses so decompiled code shows meaningful names; validates changes first, applying only when dry_run is false.

Instructions

Define a struct, enum or typedef, name fields of a struct or class_layout class, or apply a type at an address so decompile names its fields; at a function, type sets the prototype. Checked first; dry run until dry_run=false.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "set_type"
  }
}

Input Schema

NameRequiredDescriptionDefault
varNoVariable or field to name/type (`a1`, `local_58`, a debug-info name, `field_0x10`).
nameNoStruct, enum, typedef or class, or `var`'s new name.
sizeNoSize past the last field, or an enum's width (4 or 8).
typeNoType to apply or typedef (`Player *`), a prototype, or alone C declarations.
fieldsNoEach `offset:name[:type]` (`0x1c:mp:u32`), merged by offset.
valuesNoEnum values, each `name:value` (`Run:1`).
addressNoData global to type, or a function for a prototype or `var`.
dry_runNoFalse applies.
replaceNoDrop fields not restated.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.3.0
    • changedInput schema / properties / dry_run / description
      Previous value: -"Preview only; false applies."New value: +"False applies."
    • changedInput schema / properties / fields / description
      Previous value: -"Struct fields, each `offset:name:type` (`0x1c:mp:u32`)."New value: +"Each `offset:name[:type]` (`0x1c:mp:u32`), merged by offset."
    • changedInput schema / properties / name / description
      Previous value: -"Struct, enum or typedef to define, or `var`'s new name."New value: +"Struct, enum, typedef or class, or `var`'s new name."
    • addedInput schema / properties / replace
      Added value: +{
      +  "description": "Drop fields not restated.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / var / description
      Previous value: -"Function variable to name/type (`a1`, `local_58`)."New value: +"Variable or field to name/type (`a1`, `local_58`, a debug-info name, `field_0x10`)."
  2. First observedv0.2.1

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotent=true, destructiveHint=false, so safety basics are covered. The description adds genuinely non-redundant behavior: the operation is validated first ('Checked first') and is a dry run by default, only mutating when dry_run=false is explicitly passed — a critical nuance an agent would otherwise miss given a mutating annotation. It does not say what happens on validation failure or how conflicts between merged fields are reported.

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?

Two compact sentences, front-loaded with the primary verb and ending with the operational constraint about dry run, with no filler. Some clauses are terse to the point of ambiguity (for example 'Checked first' never states what checks it).

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

Completeness3/5

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

For a nine-parameter, zero-required, multi-mode tool with no output schema, the description covers the modes but never states which parameters each mode needs (name+fields for a struct, values for an enum, type alone for declarations). An agent has no output schema to lean on, so the missing mode-to-parameter mapping is a real gap, though the dry-run contract is well covered.

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%, so the baseline is 3. The description does add a little mode semantics — `type` acting as a prototype when at a function, `address` targeting a function versus a data global — but it does not map the remaining overloaded parameters (`var`, `name`, `fields`) to specific modes, so the added meaning is marginal.

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 specific verbs and resources: define a struct/enum/typedef, name fields of a struct or class_layout class, apply a type at an address, or set a function prototype. It also signals effect on the sibling `decompile` output and references `class_layout` classes, though the multiple modes are packed into one sentence rather than enumerated, leaving the agent to parse which verb applies to which parameter set.

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?

Usage is implied by the situational clauses ('at a function', 'at an address'), but there is no explicit when-not guidance or routing to alternatives such as set_name or types, which overlap with the 'name fields' and 'type' behaviors. The dry-run note is a usage requirement of sorts, but it is about application state, not tool selection.

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