Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,22 @@ not the MCP tool names.
| `script_create` / `script_attach` / `script_patch` | Create, attach, anchor-edit GDScript files |
| `project_run` | Play the project (autosave persists in-memory MCP edits unless `autosave=False`) |
| `test_run` | Run GDScript test suites in the editor |
| `logs_read` | Read plugin / game / editor / combined log buffers. `source="editor"` surfaces parse errors + @tool/EditorPlugin runtime errors + push_error/push_warning (Godot 4.5+, filtered to user .gd/.cs) — use this when the editor's Output panel shows red lines but `logs_read` returned nothing |
| `logs_read` | Read plugin / game / editor / combined log buffers. `source="editor"` surfaces parse errors, GDScript reload warnings, @tool/EditorPlugin runtime errors, push_error/push_warning, and visible Debugger dock Errors-tab rows — use this when the editor's Output or Debugger Errors panel shows red/yellow rows |
| `editor_screenshot` | Capture editor viewport, cinematic camera, or running game framebuffer |
| `editor_reload_plugin` | Reload the plugin and wait for reconnect (server must be external) |
| `animation_create` | Create an Animation clip (auto-creates AnimationPlayer + library if missing) |

`logs_read` also accepts `include_details=true` for `source="editor"`,
`source="game"`, and `source="all"`. Detailed entries include the original
Godot `_log_error` code/rationale when available, error type, resolved source
location, and stack/error-tree context corresponding to the Debugger dock's
Errors tab.

`editor_manage(op="logs_clear")` accepts `clear_debugger_errors=true` to also
clear the Debugger dock's visible Errors-tab rows (routed through the panel's
own Clear path so the tab badge and counters reset). The Errors panel is
user-facing UI, so the default leaves it untouched.

## Domain rollups (`<domain>_manage`)

Each rollup is a single MCP tool dispatched by `op` name + `params` dict.
Expand Down
14 changes: 12 additions & 2 deletions plugin/addons/godot_ai/debugger/mcp_debugger_plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,24 @@ func _capture(message: String, data: Array, session_id: int) -> bool:
func _on_log_batch(data: Array) -> void:
if _game_log_buffer == null:
return
## data layout: [[[level, text], [level, text], ...]]
## data layout: [[[level, text, details?], ...]]
if data.is_empty() or not (data[0] is Array):
return
var entries: Array = data[0]
for entry in entries:
if entry is Dictionary:
var dict_details: Dictionary = {}
var raw_dict_details = entry.get("details", {})
if raw_dict_details is Dictionary:
dict_details = raw_dict_details
_game_log_buffer.append(str(entry.get("level", "info")), str(entry.get("text", "")), dict_details)
continue
if not (entry is Array) or entry.size() < 2:
continue
_game_log_buffer.append(str(entry[0]), str(entry[1]))
var details: Dictionary = {}
if entry.size() > 2 and entry[2] is Dictionary:
details = entry[2]
_game_log_buffer.append(str(entry[0]), str(entry[1]), details)


## Request a game-process framebuffer capture over the debugger channel.
Expand Down
Loading
Loading