Skip to main content
Glama

search_classes

Read-onlyIdempotent

Search game classes, structs, and enums by name substring, base type, or assembly to locate mod hook targets. Filter to enums for constant tables and page results for large sets.

Instructions

搜索游戏里的类、结构体、枚举 —— Mod 开发最主要的入口。支持按基类与程序集过滤。

返回结果里带 handle,结果集较大时可用 read_query_result 翻页, 并可用它的 pattern 参数在结果内再过滤。

下游工具该用哪个名字:用 nested_name,不要用 full_name。 嵌套类型(状态机 State、协程体 <Xxx>d__0、私有内部类)的 full_name 只是短名(IL2CPP 的 namespace 只属于最外层类型), 实测 20,072 个类型里有 131 个叫 State,只有 1 个是顶层。 拿短名去查,会命中一堆同名类型,或直接被判为歧义而拒绝。 nested_name(如 Outer.Inner)才是能唯一定位的那个。

Args: pattern: 名称子串(大小写不敏感)。空表示不过滤。 subtype_of: 只要继承自该类型的(如 "UnityEngine.MonoBehaviour")。 assembly: 按程序集名过滤(子串,如 "TeamTapas")。 only_enums: 只要枚举(找游戏常量表很有用)。 limit: 本页最多返回多少条(上限 2000)。

Returns: {ok, handle, total, returned, has_more, items: [{full_name, nested_name, namespace, method_count, field_count, is_enum, image, token}]}

Input Schema

NameRequiredDescriptionDefault
limitNo
offsetNo
patternNo
assemblyNo
only_enumsNo
subtype_ofNo
exclude_compiler_generatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover readOnly/idempotent/non-destructive, and the description adds real value on top: results carry a `handle`, large result sets must be paged, ambiguous short names are rejected outright, and the 2000-item page cap. It omits the prerequisite that a game session must be open (open_game/get_session are siblings), which is the main behavioral gap.

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 and filters are front-loaded, then the Args/Returns blocks. The nested_name vs full_name section is the longest part but earns its space by citing a concrete failure mode (131 types named `State`, only 1 top-level). The 20,072 figure is illustrative padding that could be trimmed.

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 7-param search tool with no output schema, the inline Returns block compensates well (ok/handle/total/returned/has_more/items with field names). What's missing is the session prerequisite and any explanation of `offset` / `exclude_compiler_generated`, leaving two knobs an agent must guess at.

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 carries the burden, and it documents pattern, subtype_of, assembly, only_enums, and limit (including the 2000 ceiling that the schema does not state). Two of seven params are undocumented: `offset` and especially `exclude_compiler_generated`, whose non-obvious default of true interacts directly with the coroutine-body caveat the description raises.

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?

States a specific verb+resource set ("搜索游戏里的类、结构体、枚举") and positions itself as the primary entry point for mod development. The resource boundary versus search_fields, search_methods, and class_detail is obvious from the naming, and the read_query_result follow-up makes the tool's role in a two-step flow explicit.

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?

Gives a clear when-to-use-which rule for the downstream step: use the returned `handle` with read_query_result for paging and re-filter inside results with its `pattern` param. It also gives a concrete anti-pattern warning (don't query by full_name). It never says when to prefer class_detail or search_fields over this tool, so an exclusion is missing.

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