Skip to main content
Glama

step_into

Execute the next line of code and enter any function calls to follow execution flow during PHP debugging with Xdebug.

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

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

  • MCP handler function for the step_into tool. Resolves the debug session by ID, calls session.stepInto(), and returns a formatted text 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.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 definition using Zod for the step_into tool, allowing an optional session_id.
    { session_id: z.string().optional().describe('Session ID'), },
  • Registers the step_into MCP tool on the server inside registerExecutionTools function.
    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), }), }, ], }; } } );
  • Helper method in DebugSession class that sends the underlying DBGP 'step_into' command and handles the response.
    async stepInto(): Promise<{ status: DebugStatus; file?: string; line?: number }> { const response = await this.connection.sendCommand('step_into'); return this.handleStepResponse(response); }
  • Top-level call to registerExecutionTools (which registers step_into) in registerAllTools.
    registerExecutionTools(server, ctx.sessionManager);

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