Skip to main content
Glama

find_class_methods

Locate a class in a Python file and retrieve its methods, argument signatures, type annotations, line numbers, and docstrings.

Instructions

Locate a specific class within a Python file and retrieve all its methods, argument signatures, type annotations, line numbers, and docstrings.

:param file_path: Path to the Python file containing the class. :param class_name: Name of the target class to inspect.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
class_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the transparency burden and does clearly state what is inspected and returned. However, it does not disclose error behavior (e.g., class not found) or explicitly note that this is a read-only AST-level inspection, leaving some behavioral ambiguity.

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 compact and front-loaded: one purpose sentence followed by two param lines. Every sentence earns its place, with no filler or repetition of the schema.

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

Completeness4/5

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

For a simple two-parameter inspection tool with an output schema, the description adequately covers purpose and parameter meanings. It omits usage alternatives and failure behavior, but the output schema handles return-structure documentation, so this is reasonably complete.

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 description coverage is 0%, but the description gives meaningful one-sentence docs for both parameters: file_path and class_name. This adds value beyond the raw schema, though it could have included more nuance such as path resolution or whether class_name needs to be fully qualified.

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 ('Locate') and resource ('a specific class within a Python file'), then enumerates exact outputs: methods, argument signatures, type annotations, line numbers, and docstrings. This clearly distinguishes it from sibling tools like analyze_file_ast and find_symbol, which have broader or different scopes.

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

Usage Guidelines2/5

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

No guidance is given on when to use this tool instead of analyze_file_ast or find_symbol, and no exclusions or prerequisites are provided. The use case is only implied by the description of locating a class and retrieving its methods.

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/m-sameerkhan/code-ast-mcp'

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