step_out
Continue execution until the current function returns, stepping out to the calling context during PHP debugging with Xdebug.
Instructions
Step out of the current function. Execution continues until the current function returns.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | Session ID |
Implementation Reference
- src/tools/execution.ts:190-236 (handler)The MCP tool handler for 'step_out'. It resolves the debug session using SessionManager, calls session.stepOut(), and returns a formatted 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.stepOut(); return { content: [ { type: 'text', text: JSON.stringify({ status: result.status, file: result.file, line: result.line, message: result.status === 'break' ? `Stepped out to ${result.file}:${result.line}` : `Status: ${result.status}`, }), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'Step out failed', message: error instanceof Error ? error.message : String(error), }), }, ], }; } }
- src/tools/execution.ts:184-237 (registration)Registration of the 'step_out' MCP tool using server.tool(), including the tool name, description, input schema (optional session_id), and inline handler function.server.tool( 'step_out', 'Step out of the current function. Execution continues until the current function returns.', { 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.stepOut(); return { content: [ { type: 'text', text: JSON.stringify({ status: result.status, file: result.file, line: result.line, message: result.status === 'break' ? `Stepped out to ${result.file}:${result.line}` : `Status: ${result.status}`, }), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'Step out failed', message: error instanceof Error ? error.message : String(error), }), }, ], }; } } );
- src/tools/execution.ts:187-189 (schema)Input schema for the 'step_out' tool: optional session_id string.{ session_id: z.string().optional().describe('Session ID'), },
- src/session/session.ts:302-305 (helper)DebugSession.stepOut() helper method that sends the DBGP 'step_out' command to the connection and processes the response via handleStepResponse.async stepOut(): Promise<{ status: DebugStatus; file?: string; line?: number }> { const response = await this.connection.sendCommand('step_out'); return this.handleStepResponse(response); }