Skip to main content
Glama

step_into

Execute debugging by stepping into function calls during PHP application debugging with Xdebug, allowing detailed inspection of code execution flow.

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

TableJSON Schema
NameRequiredDescriptionDefault
session_idNoSession ID

Implementation Reference

  • The handler function for the 'step_into' MCP tool. It resolves the debug session, calls session.stepInto(), and returns a formatted text response with status, file, line, or error.
    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), }), }, ], }; }
  • Input schema for the 'step_into' tool: optional session_id string.
    session_id: z.string().optional().describe('Session ID'), },
  • MCP server.tool registration for the 'step_into' tool, including name, description, schema, and handler.
    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), }), }, ], }; } } );
  • DebugSession.stepInto() method: sends DBGP 'step_into' command and handles response.
    async stepInto(): Promise<{ status: DebugStatus; file?: string; line?: number }> { const response = await this.connection.sendCommand('step_into'); return this.handleStepResponse(response); }
  • Shared helper method to process responses from step commands, extracting status, file, and line.
    private handleStepResponse(response: DbgpResponse): { status: DebugStatus; file?: string; line?: number; } { const status = response.status || 'break'; this.status = status; if (response.message) { this.currentFile = response.message.filename; this.currentLine = response.message.lineno; } return { status, file: this.currentFile, line: this.currentLine, }; }

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