Skip to main content
Glama

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

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

  • 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), }), }, ], }; } }
  • 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 }) => {
  • 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), }), }, ], }; } } );
  • 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); }

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