get_inheritance_chain
Returns the inheritance chain of a C++ class or struct, including bases and derived with access and virtual flags. Optionally traverse full hierarchy.
Instructions
Read-only. Return the C++ inheritance chain for a class or struct.
Shows direct base classes (what this inherits from) and direct derived classes (what inherits from this), along with access level and virtual flag for each edge.
When transitive=True, walks the full hierarchy up to all ancestors
and down to all descendants (bounded by max_depth). Uses BFS with
cycle detection to handle diamond inheritance.
Returns: dict: { name, qualified_name, kind, file, line, bases: [{name, usr, access, is_virtual, file}], derived: [{name, usr, access, is_virtual, file}], all_bases: [...] (when transitive=True, ancestors sorted by depth), all_derived: [...] (when transitive=True, descendants sorted by depth) }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_depth | No | Maximum BFS depth for transitive walk (default 10). | |
| class_name | Yes | Class or struct name to get inheritance information for. E.g. 'UART_DRIVER' or 'zbox::ZMODEM'. | |
| transitive | No | When True, walk the full inheritance tree both up (ancestors) and down (descendants). Default: False (direct bases and derived only). | |
| project_root | No | Project root. Auto-detected if omitted. |