get_class_members
Retrieve all methods, fields, and nested types of a C/C++ class or struct, grouped by kind with signatures and virtual flags. Distinguishes class members from free functions.
Instructions
Return all methods, fields, and nested types of a C/C++ class/struct — libclang-powered member table. Groups members by kind (method, constructor, field, enum, etc.), distinguishing class members from free functions across the entire codebase.
Members are grouped by kind (method, constructor, destructor, field, enum, typedef, class, struct). Each member includes its signature, virtual flags, and source line. Works for C structs too — they just won't have methods.
For inheritance hierarchy use get_inheritance_chain. For individual
method details use get_symbol_context.
Read-only. No side effects.
Args:
class_name: Class or struct name. E.g. 'ModemManager' or
'comm::MODEM'.
project_root: Project root. Auto-detected if omitted.
project: Project name or project_id — call list_projects to get them. Use
it to ask about a project that is not the project of the current
directory. It is an alternative to project_root, which takes a root
path. Give one of the two, not both.
limit: Maximum members on one page (default 200, max 500).
offset: Skip this many members. Reads the next page; page
names the offset to use.
variant: Variant of the build (a board, or a PlatformIO
environment). On a project of more than one build, give the
arguments of one build as the refusal lists them: the
variant, the image, or the two. fw-context does not select a
build. One query answers for ONE build.
image: Image of the build: a separate program, such as the
application or the bootloader. Give it when the build has an
image name.
Returns: dict: {name, qualified_name, kind, file, line, members: {kind: [{name, qualified_name, signature, is_virtual, is_pure_virtual, line}]}, member_count (int — every member), page}
``page`` is the page notice ``{total, offset, shown, more,
hint}``. A page holds the members in the order kind, name and
line, and groups them by kind after the cut, thus one kind can go
on on the next page. A page after the last member gives one
``info`` dict that names the total.
When a file of the answer changed after the last index run, the
dict adds ``stale`` (True) and ``stale_warning`` (str).
On failure the dict holds ``error`` with the reason.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | No | Image of the build: a separate program, such as the application or the bootloader. On a project of more than one build, give it when that build has an image name, as the refusal lists it. | |
| limit | No | Maximum members on one page (default 200, max 500). | |
| offset | No | Skip this many members. Reads the next page of a large class. | |
| project | No | Project name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both. | |
| variant | No | Variant of the build (a board, or a PlatformIO environment). On a project of more than one build, give the arguments of one build as the refusal lists them: the variant, the image, or the two. fw-context does not select a build for you. One query answers for ONE build. | |
| class_name | Yes | Class or struct name. E.g. 'ModemManager' or 'comm::MODEM'. | |
| project_root | No | Project root. Auto-detected if omitted. This field also accepts a project name or a project_id, but project is the clear field for those. |