# engine

> 实时 ClassDB 内省+节点方法调用(editor-only):查询运行中引擎的实际可用类/方法/属性/信号/枚举,或调用编辑器场景树节点的实例方法。 class_info=类完整结构(默认 no_inherit=true 只看本类), search=substring 搜类名(上限 100,搜到后用 class_info 查详情), get_inheritance=继承链(到 Object)。 call_method=调用节点实例方法:参数按声明类型自动强转,deny-list 默认挡危险方法(free/queue_free/set_script/call 等),env GODOT_MCP_EDITOR_CALL_DENYLIST_OVERRIDE 只能追加(∪ 默认表),call 不可 undo。 ⚠️ 补 docs 工具缺口:docs 是静态 4.7 快照(不含第三方 addon/自定义类),engine 是运行中引擎真实 ClassDB。 ⚠️ editor-only:headless 模式返回 EDITOR_ONLY。

| 属性 | 值 |
|------|-----|
| 所属层 | editor |
| 安全级别 | guarded |
| 需要 Godot | 是 |
| 需要编辑器 | 是 |
| 只读 | 否 |
| 长耗时 | 否 |

## Actions

- `class_info`
- `search`
- `get_inheritance`
- `call_method`

## Parameters

| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| `action` | enum (4 项) | ✓ | 操作类型。class_info=类完整结构, search=substring 搜类名, get_inheritance=继承链, call_method=调用节点实例方法 |
| `class` | string |  | class_info/get_inheritance: 类名（如 Node、Sprite2D、RigidBody3D，或第三方 addon 注册的类名） |
| `query` | string |  | search: substring 匹配类名（大小写不敏感） |
| `no_inherit` | boolean |  | class_info: true=只看本类 own 成员（默认，翻继承链会淹没新 API）；false=含继承链合并 |
| `node_path` | string |  | call_method: 目标节点路径（如 "root/Player"、"Player/Sprite2D"，相对编辑器场景树根） |
| `method` | string |  | call_method: 要调用的方法名（方法不存在时返回 did-you-mean 建议；deny-list 默认挡 free/queue_free/set_script/call 等危险方法） |
| `args` | array |  | call_method: 位置参数数组（按方法声明类型自动强转，如 [1,2,3] 给 Vector3 参数）。最多 8 个参数 |

## 风险分布

读 3 / 写 1

---
<!-- AUTO-GENERATED by scripts/gen-tool-docs.mjs from capability-matrix.json v0.33.8. DO NOT edit manually; re-run npm run gen:tool-docs after tool changes. -->
