breakpoint-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,587 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * B1 — enforced tool output schemas.
4
+ *
5
+ * Every shape below is frozen from the source of truth: the host reshaping code
6
+ * (cli/processes/lsp/dap) and the addon handlers (operations.gd / runtime_bridge.gd),
7
+ * cross-checked against the v0.4.2 live validation run. The MCP SDK validates a
8
+ * tool's `structuredContent` against its `outputSchema` on every SUCCESS result
9
+ * (error results — `isError: true` — are exempt), so these must match the real
10
+ * runtime shape or that tool's success path throws.
11
+ *
12
+ * Notes:
13
+ * - `z.object` is non-strict, so a tool returning EXTRA fields still validates;
14
+ * the schemas pin the required envelope, not an exhaustive field list.
15
+ * - The two image tools (screenshot_editor, runtime_screenshot) return image
16
+ * content with NO structuredContent, so they are deliberately NOT listed and
17
+ * receive no outputSchema.
18
+ * - `encodedValue` is a Godot Variant run through the addon's JSON codec — a
19
+ * scalar, array, or a {"__type__": ...}-tagged object — so it stays `any`.
20
+ */
21
+ const encodedValue = z.any();
22
+ const capturedRaw = z.object({
23
+ code: z.number().nullable(),
24
+ stdout: z.string(),
25
+ stderr: z.string(),
26
+ timedOut: z.boolean(),
27
+ });
28
+ const location = z.object({ uri: z.string(), line: z.number(), character: z.number() });
29
+ // Recursive edited-scene node (scene.get_tree in operations.gd: _serialize_node).
30
+ const sceneNode = z.lazy(() => z.object({
31
+ name: z.string(),
32
+ type: z.string(),
33
+ path: z.string(),
34
+ script: z.string().nullable(),
35
+ child_count: z.number(),
36
+ children: z.array(sceneNode).optional(),
37
+ }));
38
+ // Recursive live-game node (runtime.get_tree in runtime_bridge.gd: _serialize).
39
+ const runtimeNode = z.lazy(() => z.object({
40
+ name: z.string(),
41
+ type: z.string(),
42
+ path: z.string(),
43
+ child_count: z.number(),
44
+ visible: z.boolean().optional(),
45
+ children: z.array(runtimeNode).optional(),
46
+ }));
47
+ /** name -> ZodRawShape describing that tool's structuredContent. */
48
+ export const outputSchemas = {
49
+ // ---- Plane B: headless CLI (tools/cli.ts) ----
50
+ godot_version: { version: z.string(), raw: capturedRaw },
51
+ godot_launch_editor: { launched: z.boolean(), pid: z.number().nullable(), project: z.string() },
52
+ godot_run_project: { running: z.boolean(), pid: z.number().nullable(), scene: z.string().nullable() },
53
+ godot_export: { preset: z.string(), output_path: z.string(), exit_code: z.number().nullable(), timed_out: z.boolean(), stdout: z.string(), stderr: z.string() },
54
+ godot_import: { exit_code: z.number().nullable(), timed_out: z.boolean(), stdout: z.string(), stderr: z.string() },
55
+ godot_run_headless_script: { script_path: z.string(), exit_code: z.number().nullable(), timed_out: z.boolean(), stdout: z.string(), stderr: z.string() },
56
+ // ---- Managed processes (tools/processes.ts) ----
57
+ godot_run_managed: { id: z.string(), pid: z.number().nullable(), running: z.boolean(), scene: z.string().nullable() },
58
+ godot_output: {
59
+ id: z.string(),
60
+ exited: z.boolean(),
61
+ exit_code: z.number().nullable(),
62
+ latest_seq: z.number(),
63
+ lines: z.array(z.object({ seq: z.number(), stream: z.enum(["stdout", "stderr"]), text: z.string() })),
64
+ },
65
+ godot_stop: { id: z.string(), stopped: z.boolean() },
66
+ // ---- Plane A: editor bridge (tools/editor.ts -> operations.gd) ----
67
+ editor_ping: { pong: z.boolean(), addon_version: z.string(), godot: z.string() },
68
+ editor_get_state: {
69
+ has_open_scene: z.boolean(),
70
+ edited_scene_root: z.string().nullable(),
71
+ edited_scene_path: z.string().nullable(),
72
+ root_type: z.string().nullable(),
73
+ selection: z.array(z.string()),
74
+ godot: z.string(),
75
+ },
76
+ editor_undo: {
77
+ performed: z.boolean(),
78
+ direction: z.string(),
79
+ action: z.string(),
80
+ has_undo: z.boolean(),
81
+ has_redo: z.boolean(),
82
+ history_id: z.number(),
83
+ scope: z.string(),
84
+ },
85
+ editor_redo: {
86
+ performed: z.boolean(),
87
+ direction: z.string(),
88
+ action: z.string(),
89
+ has_undo: z.boolean(),
90
+ has_redo: z.boolean(),
91
+ history_id: z.number(),
92
+ scope: z.string(),
93
+ },
94
+ project_get_info: { name: z.string(), main_scene: z.string(), project_root: z.string(), godot: z.string(), features: z.array(z.string()) },
95
+ project_get_setting: { name: z.string(), value: encodedValue },
96
+ project_set_setting: { name: z.string(), saved: z.boolean() },
97
+ scene_get_tree: {
98
+ name: z.string(),
99
+ type: z.string(),
100
+ path: z.string(),
101
+ script: z.string().nullable(),
102
+ child_count: z.number(),
103
+ children: z.array(sceneNode).optional(),
104
+ },
105
+ scene_open: { opened: z.string() },
106
+ scene_save: { saved: z.string() },
107
+ scene_new: { created: z.string(), root_type: z.string() },
108
+ scene_list_open: { scenes: z.array(z.string()), current: z.string().nullable(), unsaved: z.array(z.string()), unsaved_supported: z.boolean() },
109
+ scene_reload: { reloaded: z.string() },
110
+ scene_close: { closed: z.string() },
111
+ scene_pack: { packed: z.string(), branch: z.string() },
112
+ scene_get_dependencies: { path: z.string(), dependencies: z.array(z.string()) },
113
+ scene_save_as: { saved_as: z.string() },
114
+ node_add: { path: z.string(), name: z.string(), type: z.string() },
115
+ node_delete: { deleted: z.string() },
116
+ node_rename: { path: z.string(), name: z.string() },
117
+ node_reparent: { path: z.string() },
118
+ node_set_property: { path: z.string(), property: z.string(), value: encodedValue },
119
+ node_get_property: { path: z.string(), property: z.string(), value: encodedValue },
120
+ node_duplicate: { path: z.string(), name: z.string(), type: z.string() },
121
+ node_get_children: { path: z.string(), children: z.array(z.object({ name: z.string(), type: z.string(), path: z.string() })) },
122
+ node_find: { matches: z.array(z.object({ name: z.string(), type: z.string(), path: z.string() })), count: z.number() },
123
+ node_list_groups: { path: z.string(), groups: z.array(z.string()) },
124
+ node_add_to_group: { path: z.string(), group: z.string(), added: z.boolean() },
125
+ node_remove_from_group: { path: z.string(), group: z.string(), removed: z.boolean() },
126
+ node_instantiate_scene: { path: z.string(), name: z.string(), type: z.string(), scene: z.string() },
127
+ node_move_child: { path: z.string(), index: z.number() },
128
+ node_change_type: { path: z.string(), name: z.string(), type: z.string(), old_type: z.string() },
129
+ node_set_owner: { path: z.string(), owner: z.string().nullable() },
130
+ node_call_method: { path: z.string(), method: z.string(), result: encodedValue },
131
+ node_get_path: {
132
+ path: z.string(), name: z.string(), type: z.string(),
133
+ index: z.number(), parent: z.string().nullable(), child_count: z.number(),
134
+ },
135
+ node_list_properties: {
136
+ path: z.string(),
137
+ properties: z.array(z.object({ name: z.string(), type: z.number(), class_name: z.string(), usage: z.number() })),
138
+ },
139
+ signal_list: { path: z.string(), signals: z.array(z.object({ name: z.string(), args: z.array(z.string()) })) },
140
+ signal_list_connections: {
141
+ path: z.string(),
142
+ connections: z.array(z.object({ signal: z.string(), target: z.string().nullable(), method: z.string(), flags: z.number() })),
143
+ },
144
+ signal_connect: { signal: z.string(), source: z.string(), target: z.string(), method: z.string(), flags: z.number(), connected: z.boolean() },
145
+ signal_disconnect: { signal: z.string(), source: z.string(), target: z.string(), method: z.string(), disconnected: z.boolean() },
146
+ signal_add_user_signal: { path: z.string(), signal: z.string(), added: z.boolean() },
147
+ signal_emit: { path: z.string(), signal: z.string(), emitted: z.boolean() },
148
+ selection_get: { selection: z.array(z.string()) },
149
+ selection_set: { selection: z.array(z.string()) },
150
+ classdb_get_class: {
151
+ class: z.string(),
152
+ parent: z.string(),
153
+ can_instantiate: z.boolean(),
154
+ methods: z.array(z.string()),
155
+ properties: z.array(z.string()),
156
+ signals: z.array(z.string()),
157
+ },
158
+ // ---- Group B: resources (tools/editor.ts -> operations.gd _resource_*) ----
159
+ resource_create: { created: z.string(), type: z.string() },
160
+ resource_load: {
161
+ path: z.string(),
162
+ type: z.string(),
163
+ resource_name: z.string(),
164
+ properties: z.array(z.object({ name: z.string(), type: z.number(), class_name: z.string(), usage: z.number() })),
165
+ },
166
+ resource_save: { saved: z.string(), from: z.string() },
167
+ resource_duplicate: { duplicated: z.string(), from: z.string(), deep: z.boolean() },
168
+ resource_get_property: { path: z.string(), property: z.string(), value: encodedValue },
169
+ resource_set_property: { path: z.string(), property: z.string(), value: encodedValue },
170
+ resource_get_import_settings: { path: z.string(), imported: z.boolean(), importer: z.string(), settings: z.record(encodedValue) },
171
+ resource_set_import_settings: { path: z.string(), reimported: z.boolean(), settings: z.array(z.string()) },
172
+ // ---- Group B: filesystem (tools/editor.ts -> operations.gd _filesystem_*) ----
173
+ filesystem_list: { path: z.string(), dirs: z.array(z.string()), files: z.array(z.string()) },
174
+ filesystem_scan: { scanning: z.boolean() },
175
+ filesystem_move: { moved: z.string(), from: z.string(), moved_import: z.boolean() },
176
+ filesystem_create_dir: { created: z.string(), existed: z.boolean() },
177
+ // ---- Group C: animation (tools/editor.ts -> operations.gd _anim_*) ----
178
+ anim_player_create: { path: z.string(), name: z.string(), type: z.string() },
179
+ anim_create: { player: z.string(), library: z.string(), name: z.string() },
180
+ anim_delete: { player: z.string(), library: z.string(), deleted: z.string() },
181
+ anim_add_track: { track: z.number(), type: z.string(), path: z.string() },
182
+ anim_insert_key: { track: z.number(), time: z.number(), key_count: z.number() },
183
+ anim_remove_key: { track: z.number(), removed_key: z.number(), time: z.number() },
184
+ anim_set_length: { length: z.number(), previous: z.number() },
185
+ anim_set_loop: { mode: z.string(), previous: z.string() },
186
+ anim_get_track_keys: { track: z.number(), type: z.string(), path: z.string(), keys: z.array(z.object({ index: z.number(), time: z.number(), value: encodedValue, transition: z.number() })) },
187
+ anim_list: { player: z.string(), animations: z.array(z.object({ name: z.string(), library: z.string(), animation: z.string(), length: z.number(), loop_mode: z.string(), track_count: z.number() })) },
188
+ anim_tree_create: { path: z.string(), name: z.string(), type: z.string(), root_type: z.string(), anim_player: z.string(), active: z.boolean() },
189
+ anim_tree_add_node: { tree: z.string(), node_name: z.string(), node_type: z.string(), position: z.array(z.number()) },
190
+ anim_statemachine_add_state: { tree: z.string(), state_machine: z.string(), state_name: z.string(), node_type: z.string(), animation: z.string(), position: z.array(z.number()) },
191
+ anim_statemachine_add_transition: { tree: z.string(), state_machine: z.string(), from_state: z.string(), to_state: z.string(), xfade_time: z.number(), switch_mode: z.string(), advance_mode: z.string(), transition_count: z.number() },
192
+ // ---- Group D: TileSet (tools/editor.ts -> operations.gd _tileset_*) ----
193
+ tileset_create: { created: z.string(), tile_size: z.array(z.number()) },
194
+ tileset_add_source: { tileset: z.string(), source_id: z.number(), texture: z.string(), texture_region_size: z.array(z.number()), source_count: z.number() },
195
+ tileset_add_tile: { tileset: z.string(), source_id: z.number(), atlas_coords: z.array(z.number()), size: z.array(z.number()), tiles_count: z.number() },
196
+ tileset_set_tile_collision: { tileset: z.string(), source_id: z.number(), atlas_coords: z.array(z.number()), physics_layer: z.number(), polygon_index: z.number(), points: z.number(), one_way: z.boolean() },
197
+ // ---- Group D batch 2: TileMapLayer + cell painting (tools/editor.ts -> operations.gd _tilemap*) ----
198
+ tilemaplayer_create: { path: z.string(), name: z.string(), type: z.string(), tile_set: z.string() },
199
+ tilemap_set_cell: { path: z.string(), coords: z.array(z.number()), source_id: z.number(), atlas_coords: z.array(z.number()), alternative: z.number(), erased: z.boolean() },
200
+ tilemap_set_cells_rect: { path: z.string(), rect: z.array(z.number()), cells: z.number(), source_id: z.number(), atlas_coords: z.array(z.number()), alternative: z.number(), erased: z.boolean() },
201
+ tilemap_get_cell: { path: z.string(), coords: z.array(z.number()), source_id: z.number(), atlas_coords: z.array(z.number()), alternative: z.number(), empty: z.boolean() },
202
+ tilemap_clear: { path: z.string(), cleared_cells: z.number() },
203
+ // ---- Group E: Physics & collision (tools/editor.ts -> operations.gd _body_*/_collisionshape_add) ----
204
+ body_create: { path: z.string(), name: z.string(), type: z.string(), body: z.string(), dim: z.string() },
205
+ collisionshape_add: { path: z.string(), name: z.string(), type: z.string(), shape: z.string(), shape_class: z.string(), dim: z.string() },
206
+ body_set_collision_layer: { path: z.string(), collision_layer: z.number() },
207
+ body_set_collision_mask: { path: z.string(), collision_mask: z.number() },
208
+ // ---- Group E batch 2: areas, joints, collision polygons, rigidbody tuning, physics material, project gravity ----
209
+ area_set_monitoring: { path: z.string(), monitoring: z.boolean(), monitorable: z.boolean() },
210
+ area_set_gravity: { path: z.string(), space_override: z.string(), gravity: z.number(), direction: z.array(z.number()), gravity_point: z.boolean(), dim: z.string() },
211
+ joint_create: { path: z.string(), name: z.string(), type: z.string(), joint: z.string(), dim: z.string(), node_a: z.string(), node_b: z.string() },
212
+ joint_set_bodies: { path: z.string(), node_a: z.string(), node_b: z.string() },
213
+ collisionpolygon_add: { path: z.string(), name: z.string(), type: z.string(), dim: z.string(), points: z.number() },
214
+ rigidbody_set_properties: { path: z.string(), mass: z.number(), gravity_scale: z.number(), linear_damp: z.number(), angular_damp: z.number() },
215
+ body_set_physics_material: { path: z.string(), friction: z.number(), bounce: z.number(), rough: z.boolean(), absorbent: z.boolean() },
216
+ physics_set_gravity: { dim: z.string(), magnitude: z.number(), direction: z.array(z.number()), saved: z.boolean() },
217
+ // ---- Group F batch 1: VFX particles (tools/editor.ts -> operations.gd _particles_*) ----
218
+ particles_create: { path: z.string(), name: z.string(), type: z.string(), dim: z.string(), amount: z.number(), lifetime: z.number(), emitting: z.boolean() },
219
+ particles_set_process_material: { path: z.string(), gravity: z.array(z.number()), direction: z.array(z.number()), spread: z.number(), initial_velocity_min: z.number(), initial_velocity_max: z.number(), scale_min: z.number(), scale_max: z.number(), color: z.array(z.number()) },
220
+ particles_set_amount: { path: z.string(), amount: z.number() },
221
+ particles_set_lifetime: { path: z.string(), lifetime: z.number() },
222
+ particles_set_emitting: { path: z.string(), emitting: z.boolean() },
223
+ particles_set_texture: { path: z.string(), texture_path: z.string() },
224
+ // ---- Group F batch 2: shaders (tools/editor.ts -> operations.gd _shader_* / _shadermaterial_*) ----
225
+ shader_create: { created: z.string(), type: z.string(), code_length: z.number() },
226
+ shader_set_code: { path: z.string(), code_length: z.number() },
227
+ shadermaterial_create: { path: z.string(), target_property: z.string(), type: z.string(), shader_path: z.string() },
228
+ shadermaterial_set_shader: { path: z.string(), shader_path: z.string() },
229
+ shadermaterial_set_param: { path: z.string(), param: z.string(), value: encodedValue },
230
+ // ---- Group F batch 3: audio (tools/editor.ts -> operations.gd _audio_*) ----
231
+ audio_player_create: { path: z.string(), name: z.string(), type: z.string(), dim: z.string(), autoplay: z.boolean(), volume_db: z.number(), bus: z.string(), stream_path: z.string() },
232
+ audio_set_stream: { path: z.string(), stream_path: z.string() },
233
+ audio_bus_add: { index: z.number(), name: z.string(), send: z.string(), count: z.number() },
234
+ audio_bus_add_effect: { bus: z.string(), bus_index: z.number(), effect: z.string(), effect_count: z.number() },
235
+ audio_bus_set_volume: { bus: z.string(), bus_index: z.number(), volume_db: z.number() },
236
+ audio_set_bus_layout: { saved: z.string(), bus_count: z.number() },
237
+ // ---- Group G: UI / Control / theming (tools/editor.ts -> operations.gd _control_* / _container_* / _theme_*) ----
238
+ control_create: { path: z.string(), name: z.string(), type: z.string() },
239
+ container_add_child: { path: z.string(), name: z.string(), type: z.string(), container: z.string() },
240
+ control_set_anchors: {
241
+ path: z.string(),
242
+ anchors: z.object({ left: z.number(), top: z.number(), right: z.number(), bottom: z.number() }),
243
+ },
244
+ control_set_layout_preset: { path: z.string(), preset: z.number(), preset_name: z.string() },
245
+ control_set_size_flags: { path: z.string(), horizontal: z.number(), vertical: z.number(), stretch_ratio: z.number() },
246
+ control_set_theme: { path: z.string(), theme_path: z.string() },
247
+ theme_create: { created: z.string(), type: z.string() },
248
+ theme_set_color: { path: z.string(), name: z.string(), theme_type: z.string(), color: z.array(z.number()) },
249
+ theme_set_font: { path: z.string(), name: z.string(), theme_type: z.string(), font_path: z.string() },
250
+ theme_set_stylebox: { path: z.string(), name: z.string(), theme_type: z.string(), stylebox_path: z.string() },
251
+ theme_set_constant: { path: z.string(), name: z.string(), theme_type: z.string(), value: z.number() },
252
+ // ---- Group H: 3D & navigation (tools/editor.ts -> operations.gd _meshinstance_* / _mesh_* / _primitive_mesh_* / _light_* / _camera_* / _csg_* / _navregion_* / _navagent_* / _environment_*) ----
253
+ meshinstance_create: { path: z.string(), name: z.string(), type: z.string(), mesh_path: z.string() },
254
+ mesh_set_surface_material: { path: z.string(), material_path: z.string(), surface: z.number() },
255
+ primitive_mesh_create: { created: z.string(), type: z.string(), shape: z.string() },
256
+ light_create: { path: z.string(), name: z.string(), type: z.string(), kind: z.string() },
257
+ camera_create: { path: z.string(), name: z.string(), type: z.string(), current: z.boolean() },
258
+ csg_create: { path: z.string(), name: z.string(), type: z.string(), shape: z.string() },
259
+ navregion_create: { path: z.string(), name: z.string(), type: z.string(), has_navmesh: z.boolean() },
260
+ navagent_configure: {
261
+ path: z.string(),
262
+ name: z.string(),
263
+ type: z.string(),
264
+ config: z.object({
265
+ radius: z.number(),
266
+ height: z.number(),
267
+ max_speed: z.number(),
268
+ path_desired_distance: z.number(),
269
+ target_desired_distance: z.number(),
270
+ avoidance_enabled: z.boolean(),
271
+ }),
272
+ },
273
+ environment_create: { created: z.string(), type: z.string(), background_mode: z.string() },
274
+ environment_set_sky: { path: z.string(), background_mode: z.string(), sky_material: z.string() },
275
+ // ---- Group I: input / project config / testing (tools/editor.ts -> operations.gd _inputmap_* / _project_add_autoload / _project_remove_autoload / _project_add_export_preset / _project_set_main_scene / _project_list_settings / _editorsettings_get_set / _test_detect / _test_list) ----
276
+ inputmap_add_action: { action: z.string(), deadzone: z.number(), saved: z.boolean() },
277
+ inputmap_add_event: { action: z.string(), event_count: z.number(), event_class: z.string(), saved: z.boolean() },
278
+ inputmap_list: { count: z.number(), actions: z.array(z.object({ name: z.string(), deadzone: z.number(), events: z.array(z.object({ class: z.string(), text: z.string() })) })) },
279
+ inputmap_erase_action: { erased: z.boolean(), action: z.string(), saved: z.boolean() },
280
+ project_add_autoload: { autoload: z.string(), path: z.string(), enabled: z.boolean(), saved: z.boolean() },
281
+ project_remove_autoload: { removed: z.boolean(), autoload: z.string(), saved: z.boolean() },
282
+ project_add_export_preset: { preset: z.string(), platform: z.string(), index: z.number(), path: z.string() },
283
+ project_set_main_scene: { main_scene: z.string(), saved: z.boolean() },
284
+ project_list_settings: { prefix: z.string(), count: z.number(), settings: z.array(z.object({ name: z.string(), value: z.any() })) },
285
+ editorsettings_get_set: { name: z.string(), value: z.any(), mode: z.string() },
286
+ test_detect: { framework: z.string(), path: z.string(), version: z.string() },
287
+ test_list: { dir: z.string(), count: z.number(), tests: z.array(z.string()) },
288
+ // ---- Plane D: semantic / LSP (tools/lsp.ts) ----
289
+ gd_completion: { items: z.array(z.object({ label: z.string(), kind: z.string(), detail: z.string(), insertText: z.string() })) },
290
+ gd_hover: { contents: z.string() },
291
+ gd_definition: { locations: z.array(location) },
292
+ gd_references: { locations: z.array(location) },
293
+ gd_rename: { changed_files: z.array(z.string()), edit_count: z.number(), applied: z.boolean(), written: z.array(z.string()) },
294
+ gd_document_symbols: { symbols: z.array(z.object({ name: z.string(), kind: z.string(), line: z.number() })) },
295
+ gd_workspace_symbols: { symbols: z.array(z.object({ name: z.string(), kind: z.string(), uri: z.string(), line: z.number() })) },
296
+ gd_diagnostics: {
297
+ uri: z.string(),
298
+ diagnostics: z.array(z.object({ severity: z.string(), message: z.string(), line: z.number(), character: z.number() })),
299
+ },
300
+ gd_signature_help: {
301
+ signatures: z.array(z.object({
302
+ label: z.string(),
303
+ documentation: z.string(),
304
+ parameters: z.array(z.object({ label: z.string(), documentation: z.string() })),
305
+ })),
306
+ active_signature: z.number(),
307
+ active_parameter: z.number(),
308
+ },
309
+ gd_code_action: {
310
+ actions: z.array(z.object({ title: z.string(), kind: z.string(), has_edit: z.boolean(), command: z.string().nullable() })),
311
+ },
312
+ gd_document_highlight: {
313
+ highlights: z.array(z.object({ line: z.number(), character: z.number(), end_line: z.number(), end_character: z.number(), kind: z.string() })),
314
+ },
315
+ gd_type_definition: { locations: z.array(location) },
316
+ gd_implementation: { locations: z.array(location) },
317
+ gd_declaration: { locations: z.array(location) },
318
+ gd_folding_ranges: { ranges: z.array(z.object({ start_line: z.number(), end_line: z.number(), kind: z.string() })) },
319
+ gd_document_link: {
320
+ links: z.array(z.object({ line: z.number(), character: z.number(), end_line: z.number(), end_character: z.number(), target: z.string() })),
321
+ },
322
+ gd_formatting: { edit_count: z.number(), formatted: z.string() },
323
+ gd_document_color: {
324
+ colors: z.array(z.object({
325
+ line: z.number(), character: z.number(), end_line: z.number(), end_character: z.number(),
326
+ red: z.number(), green: z.number(), blue: z.number(), alpha: z.number(), hex: z.string(),
327
+ })),
328
+ },
329
+ // ---- Plane D: C# semantic / OmniSharp LSP (tools/cslsp.ts) ----
330
+ cs_completion: { items: z.array(z.object({ label: z.string(), kind: z.string(), detail: z.string(), insertText: z.string() })) },
331
+ cs_hover: { contents: z.string() },
332
+ cs_definition: { locations: z.array(location) },
333
+ cs_references: { locations: z.array(location) },
334
+ cs_rename: { changed_files: z.array(z.string()), edit_count: z.number(), applied: z.boolean(), written: z.array(z.string()) },
335
+ cs_document_symbols: { symbols: z.array(z.object({ name: z.string(), kind: z.string(), line: z.number() })) },
336
+ cs_workspace_symbols: { symbols: z.array(z.object({ name: z.string(), kind: z.string(), uri: z.string(), line: z.number() })) },
337
+ cs_signature_help: {
338
+ signatures: z.array(z.object({
339
+ label: z.string(),
340
+ documentation: z.string(),
341
+ parameters: z.array(z.object({ label: z.string(), documentation: z.string() })),
342
+ })),
343
+ active_signature: z.number(),
344
+ active_parameter: z.number(),
345
+ },
346
+ cs_diagnostics: {
347
+ uri: z.string(),
348
+ diagnostics: z.array(z.object({ severity: z.string(), message: z.string(), line: z.number(), character: z.number() })),
349
+ },
350
+ cs_code_action: {
351
+ actions: z.array(z.object({ title: z.string(), kind: z.string(), has_edit: z.boolean(), command: z.string().nullable() })),
352
+ },
353
+ // ---- Plane D: debugging / DAP (tools/dap.ts) ----
354
+ dbg_launch: { session_id: z.string(), state: z.string(), scene: z.string() },
355
+ dbg_attach: { session_id: z.string(), state: z.string() },
356
+ dbg_set_breakpoints: {
357
+ path: z.string(), buffered: z.boolean(),
358
+ breakpoints: z.array(z.object({ line: z.number(), verified: z.boolean() })),
359
+ // Present only when the adapter advertised a requested modifier unsupported (see tools/dap.ts).
360
+ unsupported_modifiers: z.array(z.string()).optional(),
361
+ warning: z.string().optional(),
362
+ },
363
+ dbg_continue: { state: z.string(), stopped_reason: z.string().nullable() },
364
+ dbg_step: { state: z.string(), stopped_reason: z.string().nullable() },
365
+ dbg_stack_trace: { frames: z.array(z.object({ id: z.number(), name: z.string(), source: z.string(), line: z.number() })) },
366
+ dbg_scopes: { scopes: z.array(z.object({ name: z.string(), variables_ref: z.number() })) },
367
+ dbg_variables: { variables: z.array(z.object({ name: z.string(), value: z.string(), type: z.string(), variables_ref: z.number() })) },
368
+ dbg_evaluate: { result: z.string(), type: z.string(), variables_ref: z.number() },
369
+ dbg_watch: {
370
+ watches: z.array(z.object({ expression: z.string(), value: z.string(), type: z.string(), error: z.string().nullable() })),
371
+ },
372
+ dbg_set_exception_breakpoints: {
373
+ filters: z.array(z.string()),
374
+ available_filters: z.array(z.object({ filter: z.string(), label: z.string() })),
375
+ breakpoints: z.array(z.object({ verified: z.boolean() })),
376
+ },
377
+ dbg_set_variable: { name: z.string(), value: z.string(), type: z.string(), variables_ref: z.number() },
378
+ dbg_restart: { session_id: z.string(), method: z.string(), state: z.string(), scene: z.string().nullable() },
379
+ dbg_goto: {
380
+ targets: z.array(z.object({ id: z.number(), label: z.string(), line: z.number() })),
381
+ jumped: z.boolean(),
382
+ target_id: z.number().nullable(),
383
+ },
384
+ dbg_data_breakpoints: {
385
+ breakpoints: z.array(z.object({ name: z.string(), data_id: z.string(), verified: z.boolean() })),
386
+ unresolved: z.array(z.object({ name: z.string(), reason: z.string() })),
387
+ },
388
+ // ---- Plane D: C# debugging / netcoredbg DAP (tools/csdap.ts) ----
389
+ cs_dbg_launch: { session_id: z.string(), state: z.string() },
390
+ cs_dbg_attach: { session_id: z.string(), state: z.string() },
391
+ cs_dbg_set_breakpoints: {
392
+ path: z.string(), buffered: z.boolean(),
393
+ breakpoints: z.array(z.object({ line: z.number(), verified: z.boolean() })),
394
+ // Present only when the adapter advertised the requested condition modifier unsupported (see tools/csdap.ts).
395
+ unsupported_modifiers: z.array(z.string()).optional(),
396
+ warning: z.string().optional(),
397
+ },
398
+ cs_dbg_continue: { state: z.string(), stopped_reason: z.string().nullable() },
399
+ cs_dbg_step: { state: z.string(), stopped_reason: z.string().nullable() },
400
+ cs_dbg_stack_trace: { frames: z.array(z.object({ id: z.number(), name: z.string(), source: z.string(), line: z.number() })) },
401
+ cs_dbg_scopes: { scopes: z.array(z.object({ name: z.string(), variables_ref: z.number() })) },
402
+ cs_dbg_variables: { variables: z.array(z.object({ name: z.string(), value: z.string(), type: z.string(), variables_ref: z.number() })) },
403
+ cs_dbg_evaluate: { result: z.string(), type: z.string(), variables_ref: z.number() },
404
+ cs_dbg_set_variable: { name: z.string(), value: z.string(), type: z.string(), variables_ref: z.number() },
405
+ cs_dbg_watch: {
406
+ watches: z.array(z.object({ expression: z.string(), value: z.string(), type: z.string(), error: z.string().nullable() })),
407
+ },
408
+ cs_dbg_set_exception_breakpoints: {
409
+ filters: z.array(z.string()),
410
+ available_filters: z.array(z.object({ filter: z.string(), label: z.string() })),
411
+ breakpoints: z.array(z.object({ verified: z.boolean() })),
412
+ },
413
+ // C# sessions have no scene, so — unlike dbg_restart — no `scene` field here.
414
+ cs_dbg_restart: { session_id: z.string(), method: z.string(), state: z.string() },
415
+ // ---- Plane C: runtime bridge (tools/runtime.ts -> runtime_bridge.gd) ----
416
+ runtime_get_tree: {
417
+ name: z.string(),
418
+ type: z.string(),
419
+ path: z.string(),
420
+ child_count: z.number(),
421
+ visible: z.boolean().optional(),
422
+ children: z.array(runtimeNode).optional(),
423
+ },
424
+ runtime_get_property: { path: z.string(), property: z.string(), value: encodedValue },
425
+ runtime_set_property: { path: z.string(), property: z.string(), value: encodedValue },
426
+ runtime_call_method: { return: encodedValue },
427
+ runtime_emit_signal: { emitted: z.boolean() },
428
+ runtime_inject_input: { injected: z.boolean(), kind: z.string() },
429
+ runtime_get_monitors: { monitors: z.record(z.number()) },
430
+ runtime_get_log: {
431
+ entries: z.array(z.object({ seq: z.number(), level: z.string(), message: z.string() })),
432
+ latest_seq: z.number(),
433
+ // D6: true when the Godot 4.5+ Logger capture is active (zero-config print()
434
+ // capture, no managed parent). Optional so older addons still validate.
435
+ capture: z.boolean().optional(),
436
+ },
437
+ // ---- Group K: knowledge & search ----
438
+ // Host-side project index (tools/knowledge.ts) — no bridge/LSP; read the project files directly.
439
+ project_search: {
440
+ query: z.string(),
441
+ regex: z.boolean(),
442
+ matches: z.array(z.object({ file: z.string(), line: z.number(), column: z.number(), text: z.string() })),
443
+ count: z.number(),
444
+ truncated: z.boolean(),
445
+ },
446
+ find_symbol: {
447
+ name: z.string(),
448
+ matches: z.array(z.object({ file: z.string(), line: z.number(), kind: z.string(), symbol: z.string(), text: z.string() })),
449
+ count: z.number(),
450
+ truncated: z.boolean(),
451
+ },
452
+ find_usages: {
453
+ name: z.string(),
454
+ usages: z.array(z.object({ file: z.string(), line: z.number(), column: z.number(), text: z.string() })),
455
+ count: z.number(),
456
+ truncated: z.boolean(),
457
+ },
458
+ example_snippet: {
459
+ query: z.string().nullable(),
460
+ count: z.number(),
461
+ snippets: z.array(z.object({
462
+ id: z.string(), title: z.string(), tags: z.array(z.string()),
463
+ code: z.string(), explanation: z.string(), docs_url: z.string(),
464
+ })),
465
+ available: z.array(z.string()),
466
+ },
467
+ // ClassDB-backed reference tools (tools/editor.ts -> operations.gd _classdb_reference / _docs_search).
468
+ class_reference: {
469
+ class: z.string(),
470
+ parent: z.string(),
471
+ can_instantiate: z.boolean(),
472
+ docs_url: z.string(),
473
+ methods: z.array(z.object({ name: z.string(), return_type: z.string(), args: z.array(z.object({ name: z.string(), type: z.string() })) })),
474
+ signals: z.array(z.object({ name: z.string(), args: z.array(z.object({ name: z.string(), type: z.string() })) })),
475
+ properties: z.array(z.object({ name: z.string(), type: z.string(), class_name: z.string() })),
476
+ },
477
+ docs_search: {
478
+ query: z.string(),
479
+ count: z.number(),
480
+ truncated: z.boolean(),
481
+ results: z.array(z.object({ class: z.string(), member: z.string(), kind: z.string(), docs_url: z.string() })),
482
+ },
483
+ // ---- Group J: AI asset generation (tools/assetgen.ts) ----
484
+ // asset_gen_configure reports/sets the session backend (the feature flag).
485
+ asset_gen_configure: {
486
+ backend: z.string(),
487
+ provider: z.string().nullable(),
488
+ command: z.string().nullable(),
489
+ configured: z.boolean(),
490
+ supported_kinds: z.array(z.string()),
491
+ note: z.string(),
492
+ },
493
+ // The six generators share one envelope. It must validate all three success
494
+ // outcomes — "placeholder" (in-engine), "generated" (command backend) and
495
+ // "no_backend" (degraded) — so only the always-present fields are pinned
496
+ // (path/prompt nullable; width/height/bytes/imported_type/request optional).
497
+ ...(() => {
498
+ const assetGenResult = {
499
+ status: z.string(),
500
+ kind: z.string(),
501
+ backend: z.string(),
502
+ path: z.string().nullable(),
503
+ prompt: z.string().nullable(),
504
+ message: z.string(),
505
+ };
506
+ return {
507
+ asset_gen_placeholder: assetGenResult,
508
+ asset_gen_sprite: assetGenResult,
509
+ asset_gen_texture: assetGenResult,
510
+ asset_gen_icon: assetGenResult,
511
+ asset_gen_audio_sfx: assetGenResult,
512
+ asset_gen_model: assetGenResult,
513
+ };
514
+ })(),
515
+ // ---- Group M: netcode & backend scaffolding (tools/netcode.ts) ----
516
+ // Node authoring (undoable, over the editor bridge).
517
+ mp_add_spawner: { path: z.string(), name: z.string(), type: z.string(), spawn_path: z.string(), spawnable_scenes: z.array(z.string()) },
518
+ mp_add_synchronizer: { path: z.string(), name: z.string(), type: z.string(), root_path: z.string(), properties: z.array(z.string()) },
519
+ mp_set_authority: { path: z.string(), peer_id: z.number(), previous: z.number(), recursive: z.boolean() },
520
+ // The four codegen tools share one envelope validating both the "written" and
521
+ // "unsupported" (webrtc feature-detect) outcomes — path nullable, tool-specific
522
+ // extras (bytes/created/function/annotation/stub_created) left optional (non-strict).
523
+ ...(() => {
524
+ const netcodeScaffold = {
525
+ status: z.string(),
526
+ kind: z.string(),
527
+ path: z.string().nullable(),
528
+ message: z.string(),
529
+ };
530
+ return {
531
+ mp_setup_enet_peer: netcodeScaffold,
532
+ mp_setup_webrtc_peer: netcodeScaffold,
533
+ mp_wire_rpc: netcodeScaffold,
534
+ mp_scaffold_lobby: netcodeScaffold,
535
+ };
536
+ })(),
537
+ // ---- Group M (second half): backend-SDK integration scaffolding (tools/backend.ts) ----
538
+ // backend_detect reports which SDKs are installed (read-only).
539
+ backend_detect: {
540
+ detected: z.array(z.string()),
541
+ backends: z.array(z.object({
542
+ sdk: z.string(),
543
+ installed: z.boolean(),
544
+ method: z.string().nullable(),
545
+ autoload: z.string().nullable(),
546
+ addon_dir: z.string().nullable(),
547
+ class_name: z.string().nullable(),
548
+ })),
549
+ message: z.string(),
550
+ },
551
+ // The four scaffolders share one envelope validating all three outcomes:
552
+ // "written", "sdk_missing" (degrade — SDK absent) and "unsupported_feature"
553
+ // (this SDK has no such API). path nullable; bytes/created optional (non-strict).
554
+ ...(() => {
555
+ const backendScaffold = {
556
+ status: z.string(),
557
+ sdk: z.string(),
558
+ kind: z.string(),
559
+ path: z.string().nullable(),
560
+ message: z.string(),
561
+ };
562
+ return {
563
+ backend_configure: backendScaffold,
564
+ leaderboard_scaffold: backendScaffold,
565
+ cloudsave_scaffold: backendScaffold,
566
+ auth_scaffold: backendScaffold,
567
+ };
568
+ })(),
569
+ };
570
+ /**
571
+ * Inject the frozen output schemas into every matching tool at registration
572
+ * time by wrapping `server.registerTool`, so individual tool registrations stay
573
+ * untouched and `schemas.ts` is the single source of truth. A tool that already
574
+ * declares its own `outputSchema` is left as-is. Call once, right after the
575
+ * McpServer is constructed and before any register*Tools() call.
576
+ */
577
+ export function applyOutputSchemas(server) {
578
+ const raw = server.registerTool.bind(server);
579
+ server.registerTool = (name, config, handler) => {
580
+ const outputSchema = outputSchemas[name];
581
+ if (outputSchema && config && config.outputSchema === undefined) {
582
+ config = { ...config, outputSchema };
583
+ }
584
+ return raw(name, config, handler);
585
+ };
586
+ }
587
+ //# sourceMappingURL=schemas.js.map