# debug

> 交互式调试器 — 断点管理 + Phase 2/3 调试器集成（editor-only）。 Phase 1: set/clear/list breakpoint（走 CodeEdit gutter，CMP-14 后支持自动打开脚本）。 Phase 2: stack_trace（读调用栈+变量）/ inspect_frame（切帧+读变量）/ evaluate（断点上下文 REPL）。 Phase 3: step（into/over 单步）/ continue（继续到下断点）/ pause（请求中断）/ reload_scripts（热重载）。 ⚠️ editor-only：需 GODOT_MCP_MODE=editor + 安装 Godot 插件 + 运行中游戏(F5)。 ⚠️ Phase 2/3 需游戏暂停在断点(step/inspect/evaluate)或运行中(pause/reload)。

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

## Actions

- `set_breakpoint`
- `clear_breakpoint`
- `list_breakpoints`
- `stack_trace`
- `inspect_frame`
- `evaluate`
- `step`
- `continue`
- `pause`
- `reload_scripts`

## Parameters

| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| `action` | enum (10 项) | ✓ | Action type: set_breakpoint | clear_breakpoint | list_breakpoints | stack_trace | inspect_frame | evaluate | step | continue | pause | reload_scripts |
| `path` | string |  | set/clear/list: res:// 路径的 .gd 脚本（CMP-14 后自动打开，无需预先激活 tab） |
| `line` | number |  | set/clear: 1-based 行号 |
| `frame_index` | number |  | inspect_frame: 要查看的栈帧索引（0=最内层，默认 0） |
| `expression` | string |  | evaluate: 要在断点上下文求值的 GDScript 表达式 |
| `mode` | enum: into | over |  | step: 单步模式（into=进入函数, over=跨过函数；注：Godot wire 协议不支持 out） |
| `paths` | array |  | reload_scripts: 要热重载的 res:// 脚本路径数组 |
| `all_vars` | boolean |  | stack_trace/inspect_frame: true=返回全部变量（默认截断 100 个） |
| `filter` | string |  | stack_trace/inspect_frame: 变量名子串过滤 |

## 风险分布

读 5 / 写 5

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