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 with signatures and source locations.

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.

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?

With no annotations, the description carries full burden. It explicitly states 'Read-only. No side effects.' and also describes the output structure, member grouping, and source line details. This is exemplary transparency for a query tool; it clearly communicates safety and behavior beyond what any schema could.

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 (overview, grouping details, alternatives, side-effect declaration, args, returns). However, it is slightly repetitive: the opening paragraph and the second paragraph both describe grouping by kind. It earns a 4 because the organization and front-loading are good, but it could be tightened.

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?

Despite having no output schema, the description fully specifies the return shape (dict with name, qualified_name, kind, file, line, members, member_count). It also covers purpose, grouping details, behavioral notes, and alternatives. For a read-only query tool, this is complete and leaves no major gaps for an agent to infer.

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 coverage is 100% with both class_name and project_root documented. The description repeats parameter info (e.g., 'Auto-detected if omitted') and adds a few examples, but doesn't materially exceed the schema. Per the rubric, high schema coverage sets a baseline of 3, and the description doesn't add enough extra semantics to warrant a higher score.

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 opens with a specific verb and resource: 'Return all methods, fields, and nested types of a C/C++ class/struct'. It clearly distinguishes itself from sibling tools by naming alternatives like get_inheritance_chain and get_symbol_context, and mentions the libclang-powered member table, making the purpose unmistakable.

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 usage 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, which sets expectations for when to choose this tool. This is strong when-to-use and when-not-to-use guidance.

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