Skip to main content
Glama

live_struct_layout

Merge a function's field-access offsets with live object values to confirm used offsets and infer field types for a validated struct layout.

Instructions

Combine a function's field accesses with the live values at those offsets.

struct_layout knows which offsets exist and how wide the accesses are, but not what is in them. infer_struct knows what is in them, but not which offsets the code cares about. This runs both and merges them: every offset is confirmed by code and typed by data, padding is dropped, a dword that reads as a sane float in every sample is declared float, adjacent floats are grouped into a vector, and offsets seen in only one of the two are listed separately instead of being silently dropped.

key is a loaded image (found in any engine), function is any address inside the function, and object_va is a live instance of the object that function's first argument points at. session selects the live target; the image does not have to live in that session, so a sample loaded from disk works against whatever is attached.

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>",
      "function": "<function>",
      "object_va": "<object_va>"
    },
    "name": "live_struct_layout"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYes
pidNo
sizeNo
alignNo
countNo
strideNo
sessionNo
functionYes
object_vaYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations supplied, the description carries the burden and does substantial work: it discloses that padding is dropped, that single-sample dword values can be typed as `float`, that adjacent floats are grouped into a vector, and that offsets seen by only one source are listed separately rather than discarded. What it does not state is the operation's safety profile (read-only vs. mutating), cost or runtime characteristics, or failure behavior when the function/object_va do not match.

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 capability is stated in the opening sentence and the sibling contrast follows immediately, so the structure is front-loaded and readable. There is mild redundancy between the summary sentence and the longer merge-behavior sentence, and the backtick-heavy prose is denser than necessary, but no sentence is wasted.

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?

An output schema exists, so return-value explanation is correctly omitted, and the merge semantics are well covered. However, for a 9-parameter analysis tool with zero annotation coverage, leaving five parameters (including `stride`, `count`, and `size`, which materially change what layout is produced) unexplained and not stating the operation's read-only nature leaves real gaps an agent would need to guess at.

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 0% across 9 parameters, and the prose explains only four of them meaningfully: `key` as any loaded image, `function` as any address inside the function, `object_va` as a live instance of the first argument's object, and `session` as the live-target selector. The tool-specific parameters `size`, `align`, `count`, and `stride`, plus `pid`, are left entirely undocumented in both schema and description, so the description only partially compensates.

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 first sentence states a specific verb and operation: combining field accesses with live values at those offsets. The following paragraph distinguishes it precisely from its siblings `struct_layout` (knows offsets, not contents) and `infer_struct` (knows contents, not offsets), so an agent can identify this tool without inspecting either schema.

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?

The description explicitly frames when to reach for this tool instead of the two named alternatives by stating the exact limitation each has and that this tool runs both and merges the results. It also states the practical condition that the image need not live in the target session, covering the main selection question for this operation.

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