Skip to main content
Glama

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
NameRequiredDescriptionDefault
session_idNoSession ID

Implementation Reference

  • 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), }), }, ], }; } }
  • 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), }), }, ], }; } } );
  • Input schema for the 'step_out' tool: optional session_id string.
    { session_id: z.string().optional().describe('Session ID'), },
  • 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); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kpanuragh/xdebug-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server