capture_state
Capture a snapshot of the current game state from a running Godot project to analyze or debug specific nodes and components.
Instructions
Capture a snapshot of the game state from the running project. Optionally specify a node path to narrow the capture.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodePath | No | Node path to capture state from (e.g. 'Player', 'UI/HealthBar') |
Implementation Reference
- src/tools/runtime-tools.ts:84-92 (handler)The handler function for the capture_state tool. It uses the plugin client to send the captureState command.
handler: async (ctx) => { const { nodePath } = ctx.args; const client = requirePlugin(getPluginClient()); const params: Record<string, unknown> = {}; if (nodePath) params.node_path = nodePath; const result = await client.sendCommand(PLUGIN_COMMANDS.captureState, params); return makeTextResponse({ data: result }); }, }, - src/tools/runtime-tools.ts:75-92 (registration)Registration of the capture_state tool in the createRuntimeTools function.
name: "capture_state", description: "Capture a snapshot of the game state from the running project. Optionally specify a node path to narrow the capture.", schema: { nodePath: z .string() .optional() .describe("Node path to capture state from (e.g. 'Player', 'UI/HealthBar')"), }, handler: async (ctx) => { const { nodePath } = ctx.args; const client = requirePlugin(getPluginClient()); const params: Record<string, unknown> = {}; if (nodePath) params.node_path = nodePath; const result = await client.sendCommand(PLUGIN_COMMANDS.captureState, params); return makeTextResponse({ data: result }); }, },