Skip to main content
Glama

get_subclasses

Find all subclasses of a given class recursively to assess impact of interface changes. Handles multi-level inheritance and resolves ambiguous class names with file path.

Instructions

Find all classes that extend a given class, recursively.

Use this to understand the impact of changing a class's interface: which subclasses would need updating?

Supports multi-level inheritance trees up to the specified depth. When the codebase has multiple classes sharing class_name (e.g. Django defines Field in both contrib/gis/gdal/field.py and db/models/fields/__init__.py), pass file_path to pick the intended definition. Without it, the first match wins and the response includes ambiguous: True plus a candidates list so you can retry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
class_nameYesName of the base class to find subclasses of.
depthNoHow many inheritance levels to traverse (1 = direct only).
file_pathNoWhen ambiguous, pick the definition in this file. Substring match is NOT done — pass the exact path Grafyx reports in the ``candidates`` list of an ambiguous response.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations exist, so the description carries full burden. It explains recursive traversal up to a configurable depth, handling of ambiguous class_name definitions, and the response format (ambiguous flag, candidates). It does not explicitly state it's read-only, but the nature of the operation implies it. Overall, sufficient behavioral disclosure.

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?

Two paragraphs: first sets purpose and use case, second adds detail on depth and ambiguity resolution. Every sentence adds information; no fluff. Front-loads the primary action and context.

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 complexity of recursive class hierarchy and ambiguity, the description covers key aspects: depth control, disambiguation via file_path, and response behavior. An output schema exists, so return values need not be detailed. The description is well-rounded and sufficient for the agent to use the tool correctly.

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%, baseline is 3. Description adds value beyond schema: explains depth range (1=direct only), file_path usage with substring match restriction, and the candidates retry mechanism. This enriches the agent's understanding of how to use parameters effectively.

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?

Description clearly states it finds all recursive subclasses of a given class. It differentiates from sibling tools by specifying a concrete use case: understanding the impact of changing a class's interface. This makes the tool's purpose distinct and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells when to use: to understand the impact of changing a class's interface. It also explains the ambiguity scenario and how to resolve it with file_path. However, it does not mention when not to use this tool or compare it to siblings like get_call_graph, which could be alternatives for related queries.

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/bilal07karadeniz/Grafyx'

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