step_into
Step into function calls during Node.js debugging to inspect code execution and variable states.
Instructions
Steps into function calls
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-server.js:657-694 (handler)The 'step_into' tool handler. It checks if the debugger is enabled (enabling it if not), verifies the debugger is paused, sends the 'Debugger.stepInto' command via the inspector, and returns a success or error message.
server.tool( "step_into", "Steps into function calls", {}, async () => { try { // Ensure debugger is enabled if (!inspector.debuggerEnabled) { await inspector.enableDebugger(); } if (!inspector.paused) { return { content: [{ type: "text", text: "Debugger is not paused at a breakpoint" }] }; } await inspector.send('Debugger.stepInto', {}); return { content: [{ type: "text", text: "Stepped into function call" }] }; } catch (err) { return { content: [{ type: "text", text: `Error stepping into: ${err.message}` }] }; } } ); - src/mcp-server.js:657-694 (registration)The tool is registered using server.tool() with the name 'step_into'. This is the standard MCP server tool registration pattern.
server.tool( "step_into", "Steps into function calls", {}, async () => { try { // Ensure debugger is enabled if (!inspector.debuggerEnabled) { await inspector.enableDebugger(); } if (!inspector.paused) { return { content: [{ type: "text", text: "Debugger is not paused at a breakpoint" }] }; } await inspector.send('Debugger.stepInto', {}); return { content: [{ type: "text", text: "Stepped into function call" }] }; } catch (err) { return { content: [{ type: "text", text: `Error stepping into: ${err.message}` }] }; } } ); - src/mcp-server.js:660-660 (schema)The schema is defined inline as an empty object {}, meaning the tool accepts no parameters.
{}, - src/mcp-server.js:230-274 (helper)The Inspector.send() helper method handles sending commands (including 'Debugger.stepInto') over the WebSocket to the Node.js debugger, managing pending request queues and timeouts.
async send(method, params) { return new Promise((resolve, reject) => { const timeout = setTimeout(() => { reject(new Error(`Request timed out: ${method}`)); this.pendingRequests.delete(id); }, 5000); const checkConnection = () => { if (this.connected) { try { const id = Math.floor(Math.random() * 1000000); this.pendingRequests.set(id, { resolve: (result) => { clearTimeout(timeout); resolve(result); }, reject: (err) => { clearTimeout(timeout); reject(err); } }); this.ws.send(JSON.stringify({ id, method, params })); } catch (err) { clearTimeout(timeout); reject(err); } } else { const connectionCheckTimer = setTimeout(checkConnection, 100); // If still not connected after 3 seconds, reject the promise setTimeout(() => { clearTimeout(connectionCheckTimer); clearTimeout(timeout); reject(new Error('Not connected to debugger')); }, 3000); } }; checkConnection(); }); }