Skip to main content
Glama

get_class_members

Retrieve all members of a class or struct, including methods, fields, and nested types, grouped by kind with signatures and source line information. Works for C structs as well.

Instructions

Read-only. Return all methods, fields, and nested types of a class/struct.

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.

Returns: dict: {name, qualified_name, kind, file, line, members: {kind: [...]}, 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.
Behavior4/5

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

With no annotations, the description carries the full burden. It declares 'Read-only' upfront, which sets expectations. It describes the return structure and member grouping. However, it doesn't disclose error conditions or assumptions about the input format beyond the examples.

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?

The description is concise, structured as a single paragraph with a clear return format. Every sentence adds value, and the key information ('Read-only') is front-loaded.

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 tool has 2 parameters (one required) and no output schema, the description thoroughly covers the return structure and behavior. It explains grouping by kind, inclusion of virtual flags and source line, and handling of C structs.

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 baseline is 3. The description adds value by providing concrete examples for class_name (e.g., 'ModemManager') and explains that project_root is optional with auto-detection. This clarifies usage beyond the schema.

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?

The description clearly states it returns methods, fields, and nested types of a class/struct. It mentions grouping by kind and includes C structs. However, it does not explicitly differentiate from sibling tools like get_inheritance_chain or get_method_overrides, which might have overlapping functionality.

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?

The description implies usage by stating it works for C structs as well, but does not provide explicit guidance on when to use this tool versus alternatives. No mention of prerequisites or limitations.

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