step_out
Step out of the current function to continue execution until the function returns, enabling debugging control in PHP applications.
Instructions
Step out of the current function. Execution continues until the current function returns.
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:191-236 (handler)Handler function for the 'step_out' MCP tool. Resolves the debug session using SessionManager, calls the underlying session.stepOut() method, formats the result into an MCP text content response, and handles errors.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:188-190 (schema)Input schema for 'step_out' tool using Zod: optional session_id parameter to specify which debug session to step out from.session_id: z.string().optional().describe('Session ID'), }, async ({ session_id }) => {
- src/tools/execution.ts:185-237 (registration)Registration of the 'step_out' tool in registerExecutionTools function via McpServer.tool() with name, description, schema, and handler.'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/session/session.ts:302-305 (helper)Core implementation in DebugSession class: sends DBGP 'step_out' command over the connection and processes the response using handleStepResponse.async stepOut(): Promise<{ status: DebugStatus; file?: string; line?: number }> { const response = await this.connection.sendCommand('step_out'); return this.handleStepResponse(response); }