Skip to main content
Glama

infer_struct

Samples memory objects at a given address and stride to infer their field layout, classify pointer and int32 fields, and print a C struct declaration.

Instructions

Infer a field layout from sampled values and print a C declaration.

count objects at stride are compared: a qword that is a mapped address every time is reported as a pointer, one whose high dword is always zero as int32, and fields that differ between objects are marked varies.

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

Input Schema

NameRequiredDescriptionDefault
vaYes
pidNo
sizeNo
alignNo
countNo
strideNo
sessionNodefault

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/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 and does disclose the core inference behavior: mapped addresses become pointers, high-dword-zero qwords become int32, and differing fields are flagged 'varies'. It does not say whether it attaches to or reads a live process, what permissions/session are needed, or how the heuristics degrade on ambiguous data, which keeps it below a 5.

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?

One sentence of purpose followed by one sentence of mechanism, both front-loaded with no filler. The backticked parameter names make the sampling semantics easy to scan.

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?

The output schema exists, so return values need not be described, and the classification rules are a genuine addition. However, for a 7-parameter tool with zero annotation coverage and zero schema descriptions, leaving five parameters and the sibling routing unexplained is a real gap for an agent trying to call it correctly.

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 7 parameters, and the description only explains two of them, 'count' and 'stride', in terms of how sampling works. 'va', 'pid', 'size', 'align', and 'session' receive no meaning at all from either source, so the description compensates for only a fraction of the documentation gap.

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 and resource ('Infer a field layout from sampled values') and even names the output artifact ('print a C declaration'), so the agent knows exactly what it gets back. It does not distinguish itself from the close siblings 'live_struct_layout' and 'struct_layout', leaving the agent to guess which layout tool applies.

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 only implied: the phrase 'from sampled values' and the sampling parameters suggest this is for heuristic inference from runtime memory rather than a static/source-derived layout. There is no explicit when-to-use statement, no exclusion, and no mention of the competing layout tools.

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