Skip to main content
Glama

get_class_source

Read-onlyIdempotent

Fetches a class's source code, including methods, by class name so AI assistants can inspect or edit it without raw text searches.

Instructions

Fetch a class source body (including methods).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
hintsNoAppend a one-line get_full_context hint (default true).
levelNo
namesNoBatch mode: list of names (max 10). Returns {name: result} dict. Mutually exclusive with 'name'.
projectNoProject name/path (default: active).
file_pathNo
max_linesNoCap lines (0=all, level=0 only).
class_nameNoAlias de `name`.
force_fullNoBypass symbol cache.
symbol_nameNoAlias de `name`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv4.20.0
    • addedInput schema / properties / class_name
      Added value: +{
      +  "description": "Alias de `name`. ",
      +  "type": "string"
      +}
    • addedInput schema / properties / symbol_name
      Added value: +{
      +  "description": "Alias de `name`. ",
      +  "type": "string"
      +}
  2. Addedv4.0.0

TDQS

C2.7/5.0
Behavior2/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds only the content-scope note '(including methods)' and says nothing about caching (relevant given force_full), level-based truncation, or batch return shape.

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?

A single, front-loaded sentence with zero filler. It is efficient, though arguably terse given the tool's complexity, so it stops short of a 5.

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

Completeness2/5

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

For a 10-parameter tool with no output schema, aliases (class_name, symbol_name), a batch mode, caching bypass, and level-based line capping, the description is far too thin. It leaves the agent to infer most operational behavior from the schema alone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 70% with 10 parameters, and several key inputs ('name', 'level', 'file_path') carry no schema description at all. The description mentions none of the parameters, so it does not compensate for the coverage gap, particularly the mutually exclusive name/names batch behavior.

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?

States a specific verb and resource ('Fetch a class source body') and scopes the content with '(including methods)', which cleanly separates it from the sibling get_function_source. It does not name the sibling explicitly, but the class-vs-function distinction is inferable from the resource.

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?

There is no when-to-use guidance, no mention of when to prefer this over get_function_source or get_full_context, and no guidance on the batch 'names' mode versus the single 'name' mode. Usage is only implied by the verb.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.