Skip to main content
Glama

get_class_members

Retrieve all methods, fields, and nested types of a C/C++ class or struct, grouped by kind for easy navigation.

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 'zbox::ZMODEM'. project_root: Project root. Auto-detected if omitted.

Returns: dict: {name, qualified_name, kind, file, line, members: {kind: [{name, qualified_name, signature, is_virtual, is_pure_virtual, line}]}, member_count}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
class_nameYesClass or struct name. E.g. 'ModemManager' or 'zbox::ZMODEM'.
project_rootNoProject root. Auto-detected if omitted.
Behavior5/5

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

Despite no annotations, the description fully discloses behavior: 'Read-only. No side effects.' It explains the grouping by kind, inclusion of signature and virtual flags, and source line. No contradictions.

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 description is well-structured with clear sections, but it is slightly verbose. Each sentence adds value, but the level of detail could be trimmed without losing clarity. Nonetheless, it is not excessive.

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

Completeness5/5

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

Given the absence of an output schema, the description fully explains the return format (dict with members grouped by kind) and includes all relevant details. It also notes edge cases like C structs lacking methods.

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%, but the description adds value with examples for class_name ('ModemManager' or 'zbox::ZMODEM') and clarifies auto-detection for project_root. This goes beyond the schema descriptions.

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 description uses specific verbs ('Return all methods, fields, and nested types') and clearly identifies the resource (C/C++ class/struct). It distinguishes from sibling tools by mentioning 'get_inheritance_chain' and 'get_symbol_context' for different use cases.

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?

Explicit guidance is provided: 'For inheritance hierarchy use get_inheritance_chain. For individual method details use get_symbol_context.' It also clarifies that it works for C structs and distinguishes class members from free functions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/turbyho/fw-context-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server