Skip to main content
Glama

class_hierarchy

Read-onlyIdempotent

View a class's inheritance chain to find its base classes or derived subclasses layer by layer, with adjustable depth and assembly disambiguation for same-named types.

Instructions

查看类的继承体系(向上找基类、向下找派生类)。direction="down" 是逐层的:depth 是所在层、parent 是真实直接父类;单层超 500 条时 down_has_more=true。

同类名跨程序集时会拒绝并给出候选(与 class_detail 同一规则)。 (早期版本把传递式后代当成直接子类,depth/parent 是错的 —— 现在两者用途已分开, 想一次捞全所有脚本请用 find_derived_classes。)

Args: full_name: 类完整名。 direction: up / down / both。 depth: 向下递归深度。 assembly: 同名类消歧用(子串匹配,如 "TeamTapas")。

Input Schema

NameRequiredDescriptionDefault
depthNo
assemblyNo
directionNoboth
full_nameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover read-only/idempotent/closed-world safety, and the description still adds real behavioral traits: down is level-by-level with depth and parent meaning level and true direct parent, a single layer exceeding 500 entries sets down_has_more=true, and cross-assembly name collisions are rejected with candidates offered. It also flags the corrected legacy bug so an agent does not misread depth/parent — exactly the kind of context structured fields cannot carry.

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?

Purpose is front-loaded in the first clause, followed by semantics, then caveats, then Args — a sensible order with no filler. The parenthetical note about the earlier buggy version is useful but sits awkwardly next to the find_derived_classes pointer, slightly muddling the routing message.

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 4-parameter, read-only tool with no output schema, the definition covers purpose, directional semantics, truncation behavior, disambiguation failure mode, and the alternative tool. It does not state what the result looks like beyond down_has_more/parent, nor what happens for a nonexistent full_name, which are the main remaining holes.

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 0%, so the description must carry the load, and the Args section defines all four parameters including the up/down/both values for direction and substring matching for assembly. Gaps remain: the depth default of 6 and any bounds are unstated, and no accepted values are shown for direction beyond the bare list.

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 and resource (查看类的继承体系) and immediately scopes it to upward base-class lookup and downward derived-class lookup. It names the sibling it is not (find_derived_classes for grabbing all transitive descendants at once) and ties itself to class_detail's disambiguation rule, so an agent can place it precisely among 40+ siblings.

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?

It routes the agent explicitly: use find_derived_classes to fetch all transitive descendants in one shot, and use assembly to resolve same-named classes across assemblies. What is missing is a positive statement of the primary use case (e.g. 'use this to understand the local inheritance shape of one class') and any when-not-to-use condition beyond the transitive bulk case.

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