step_into
Execute the next line of code and enter any function calls to follow execution flow during PHP debugging with Xdebug.
Instructions
Step into the next function call, or to the next line if not a function call. This follows execution into called functions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | Session ID |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"session_id": {
"description": "Session ID",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/tools/execution.ts:78-123 (handler)MCP handler function for the step_into tool. Resolves the debug session by ID, calls session.stepInto(), and returns a formatted text response with status, file, line, and message.async ({ session_id }) => { const session = sessionManager.resolveSession(session_id); if (!session) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'No active debug session' }), }, ], }; } try { const result = await session.stepInto(); return { content: [ { type: 'text', text: JSON.stringify({ status: result.status, file: result.file, line: result.line, message: result.status === 'break' ? `Stepped to ${result.file}:${result.line}` : `Status: ${result.status}`, }), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'Step into failed', message: error instanceof Error ? error.message : String(error), }), }, ], }; }
- src/tools/execution.ts:75-77 (schema)Input schema definition using Zod for the step_into tool, allowing an optional session_id.{ session_id: z.string().optional().describe('Session ID'), },
- src/tools/execution.ts:72-125 (registration)Registers the step_into MCP tool on the server inside registerExecutionTools function.server.tool( 'step_into', 'Step into the next function call, or to the next line if not a function call. This follows execution into called functions.', { session_id: z.string().optional().describe('Session ID'), }, async ({ session_id }) => { const session = sessionManager.resolveSession(session_id); if (!session) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'No active debug session' }), }, ], }; } try { const result = await session.stepInto(); return { content: [ { type: 'text', text: JSON.stringify({ status: result.status, file: result.file, line: result.line, message: result.status === 'break' ? `Stepped to ${result.file}:${result.line}` : `Status: ${result.status}`, }), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'Step into failed', message: error instanceof Error ? error.message : String(error), }), }, ], }; } } );
- src/session/session.ts:292-295 (helper)Helper method in DebugSession class that sends the underlying DBGP 'step_into' command and handles the response.async stepInto(): Promise<{ status: DebugStatus; file?: string; line?: number }> { const response = await this.connection.sendCommand('step_into'); return this.handleStepResponse(response); }
- src/tools/index.ts:57-57 (registration)Top-level call to registerExecutionTools (which registers step_into) in registerAllTools.registerExecutionTools(server, ctx.sessionManager);