Skip to main content
Glama

find_derived_classes

Read-onlyIdempotent

Finds all types inheriting from a specified base class, including indirect subclasses. Use the assembly filter to isolate a game's MonoBehaviour scripts for Mod hooking.

Instructions

找出所有继承自某个基类的类型(含间接继承);配 assembly= 可筛出游戏自己的 MonoBehaviour 脚本(找脚本的必备工具)。

total 是匹配总数,被 limit 截断时 has_more=true。

两个最常见的用法:

· 找游戏自己写的 MonoBehaviour 脚本(Mod 最常 Hook 的目标): find_derived_classes(base_full_name="UnityEngine.MonoBehaviour", assembly="Assembly-CSharp") 传 assembly 比按程序集名前缀猜「哪些是引擎自带的」可靠。 · 找所有 UI 面板 / 数据服务:把 base_full_name 换成对应基类即可。

基类不必在当前索引的程序集里(如 UnityEngine.MonoBehaviour 属于框架程序集),这种情况结果依然有效,并在 note 里如实说明。

total 是匹配总数,不受 limit 影响;returned 才是本次返回条数。 若 has_more 为 True,说明被 limit 截断了,还有结果没返回。

Args: base_full_name: 基类完整名,如 "UnityEngine.MonoBehaviour"。 assembly: 只看该程序集(子串匹配,如 "TeamTapas")。留空不限。 limit: 最多返回多少条(total 仍是匹配总数)。

Returns: {ok, found, base, total, returned, has_more, items: [{index, full_name, image, field_count, method_count}]}

Input Schema

NameRequiredDescriptionDefault
limitNo
assemblyNo
base_full_nameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already cover readOnly/idempotent/non-destructive/closed-world, and the description adds genuine behavior: base classes outside the index still yield valid results with an explanatory note, plus total vs returned vs has_more truncation semantics. However it repeats that total is unaffected by limit twice, so added value is diluted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loading is good, but the total/limit/has_more rule is stated three times across the body, and the Args/Returns blocks restate material already given in prose. Tightening to one statement of the pagination rule would lose nothing.

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?

There is no output schema, but the Returns block enumerates every field including item shape, and edge cases (base outside the index, truncation) are covered. An agent has everything needed to call it and interpret the result.

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

Parameters5/5

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

Schema coverage is 0%, and the description fully compensates: base_full_name needs the fully-qualified name with an example, assembly is substring-matched (a detail absent from the schema), and limit caps only returned rows while total stays the full match count.

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: find all types deriving from a base class, explicitly including indirect inheritance, with an optional assembly filter. Clear enough to separate from search_classes, but it never names the nearest alternative (class_hierarchy) so the distinction must be inferred.

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

Usage Guidelines5/5

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

Gives two concrete when-to-use recipes with literal call examples, including the primary Mod use case (MonoBehaviour in Assembly-CSharp). It also explains why passing assembly beats guessing from assembly-name prefixes, which is real decision guidance rather than restating the name.

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