step_debug
Step through Node.js code execution during debugging to inspect program flow and identify issues. Use actions like next, step, continue, or out to control execution.
Instructions
Step through code execution
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Debug action to perform |
Implementation Reference
- src/index.ts:559-609 (handler)The main handler function for the 'step_debug' tool. It checks for an active debug session, then uses the Chrome DevTools Protocol (CDP) Debugger domain to perform the specified stepping action: stepOver (next), stepInto (step), resume (continue), or stepOut (out). Returns success or error message.private async stepDebug(args: { action: "next" | "step" | "continue" | "out" }) { if (!this.debugSession.connected || !this.debugSession.client) { return { content: [ { type: "text", text: "No active debug session. Please attach debugger first.", }, ], isError: true, }; } try { const { Debugger } = this.debugSession.client; // Use CDP to perform the step action switch (args.action) { case "next": await Debugger.stepOver(); break; case "step": await Debugger.stepInto(); break; case "continue": await Debugger.resume(); break; case "out": await Debugger.stepOut(); break; } return { content: [ { type: "text", text: `Performed debug action: ${args.action}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error performing debug action: ${error}`, }, ], isError: true, }; }
- src/index.ts:206-216 (schema)Input schema definition for the 'step_debug' tool, specifying the 'action' parameter with allowed values.inputSchema: { type: "object", properties: { action: { type: "string", enum: ["next", "step", "continue", "out"], description: "Debug action to perform" } }, required: ["action"], },
- src/index.ts:203-217 (registration)Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema for 'step_debug'.{ name: "step_debug", description: "Step through code execution", inputSchema: { type: "object", properties: { action: { type: "string", enum: ["next", "step", "continue", "out"], description: "Debug action to perform" } }, required: ["action"], }, },
- src/index.ts:259-260 (registration)Dispatcher case in CallToolRequestSchema handler that routes 'step_debug' calls to the stepDebug method.case "step_debug": return await this.stepDebug(args as { action: "next" | "step" | "continue" | "out" });