Skip to main content
Glama

class_layout

Idempotent

Deduce a C++ class's fields, methods and vftable from how its methods access the object, then save the result as a struct.

Instructions

Infer a C++ class's fields, methods and vftable from how its methods use the object: offset, width, reads, writes. Use it on an unknown class; for a known layout use set_type. apply=Name saves it as a struct (dry run until dry_run=false).

Input Schema

NameRequiredDescriptionDefault
applyNoStruct name to define the layout as.
classYesClass name or a method address.
dry_runNoPreview only; false applies.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.6/5.0
Behavior4/5

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

Annotations establish it is a non-read-only, non-destructive, idempotent operation; the description adds the key behavioral detail that apply=Name materializes a struct and that it is only a dry run until dry_run=false, which is not derivable from annotations. It stops short of covering what happens if the struct name already exists or what the inference output looks like.

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?

Two dense sentences, front-loaded with the core inference capability, then the sibling exclusion, then the write gating. No filler.

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

Completeness4/5

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

No output schema exists, but the description enumerates what is inferred (offset, width, reads, writes) so the agent knows what comes back. Missing only edge-case behavior for re-applying over an existing struct definition.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description still adds value by tying apply and dry_run together into a single save-vs-preview rule, clarifying behavior the schema's terse 'false applies' phrasing leaves ambiguous. The 'class' parameter accepting a method address is covered by the schema, not the description.

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?

States a specific verb (infer) and precise resource (a C++ class's fields, methods, vftable) plus the evidence basis (offset, width, reads, writes). It also names the sibling it is not (set_type) so the agent can distinguish it without opening schemas.

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 scopes use to unknown classes and routes the known-layout case to set_type. The alternative and the selecting condition are both stated outright.

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