Skip to main content
Glama

struct_layout

Infer candidate struct layouts from a function's memory operands, turning observed offsets and access widths into field hypotheses you can confirm against live memory.

Instructions

Infer candidate struct layouts from the memory operands a function uses.

Every [rcx+0x10] observed becomes a field hypothesis at offset 0x10, sized by the access width. Offsets are relative and the base is a role (arg0/arg1/...) or a register, because nothing proves which object the register holds. Confirm hypotheses with read_typed against live memory.

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": {
      "key": "<key>",
      "va": "<va>"
    },
    "name": "struct_layout"
  }
}

Input Schema

NameRequiredDescriptionDefault
vaYes
keyYes
limitNo
sessionNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior3/5

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

With no annotations, the description has to carry the load, and it does disclose an important trait: results are hypotheses, offsets are relative, and the base is a role or register rather than a proven object. It omits prerequisites (does it need an attached session?), what the limit bounds, and whether the call is read-only, which matters for a tool with zero annotation coverage.

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 core purpose is front-loaded in the first sentence, followed by the derivation rule and the caveat. Every clause is substantively useful; the explanation of why bases are roles rather than objects earns its space, though the text could be trimmed slightly.

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?

An output schema exists, so return shape needn't be explained, but the description is silent on three of four arguments and on session/attach prerequisites. For an inference tool with no annotations and 0% schema coverage, the definition leaves too much for the agent to guess before calling.

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

Parameters2/5

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

Schema description coverage is 0% across four parameters (key, va, limit, session), none of which is named in the description. Only 'va' is indirectly hinted at via 'the memory operands a function uses'; key, limit (default 8000), and session remain entirely undefined in both schema and prose.

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+resource: 'Infer candidate struct layouts from the memory operands a function uses,' and explains the derivation rule ([rcx+0x10] -> field at 0x10). It does not, however, distinguish this from close siblings like live_struct_layout or infer_struct, so an agent cannot tell the pair apart from the text alone.

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 one concrete follow-up path — confirm hypotheses with read_typed against live memory — which implies this tool produces unverified output best used before a confirmation step. It never says when to prefer this over live_struct_layout or infer_struct, leaving the main routing decision to inference.

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