Skip to main content
Glama

sessions_step_in

Step into the next function call during debugging to examine code execution in detail. Requires an active breakpoint and debug session ID.

Instructions

Step into the next function call (requires active breakpoint)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe debug session ID

Implementation Reference

  • Tool registration including name, description, and input schema for sessions_step_in.
    Tool( name="sessions_step_in", description="Step into the next function call (requires active breakpoint)", inputSchema={ "type": "object", "properties": { "sessionId": { "type": "string", "description": "The debug session ID", }, }, "required": ["sessionId"], }, ), Tool(
  • MCP server handler for sessions_step_in tool. Extracts sessionId from arguments, calls SessionManager.step_in_async, formats and returns JSON response or error.
    async def _handle_sessions_step_in(self, arguments: dict) -> list[TextContent]: """ Handler for sessions_step_in tool. Steps into the next function call. """ try: session_id = arguments.get("sessionId") if not session_id: return [ TextContent( type="text", text=json.dumps({ "error": { "type": "ValueError", "message": "sessionId is required", } }), ) ] response = await self.session_manager.step_in_async(session_id) result = response.model_dump() return [ TextContent( type="text", text=json.dumps(result), ) ] except KeyError as e: return [ TextContent( type="text", text=json.dumps({ "error": { "type": "SessionNotFound", "message": str(e), } }), ) ] except Exception as e: logger.exception("Error in step_in") return [ TextContent( type="text", text=json.dumps({ "error": { "type": type(e).__name__, "message": str(e), } }), ) ]
  • SessionManager.step_in method: validates session DAP usage and PAUSED state, calls dap_wrapper.step_in, updates session state and timings.
    def step_in(self, session_id: str) -> BreakpointResponse: """ Step into the next function call (DAP only). Args: session_id: Session ID Returns: BreakpointResponse with new location and variables Raises: KeyError: If session not found ValueError: If session is not using DAP """ session = self.get_session(session_id) if not session.use_dap: return BreakpointResponse( hit=False, completed=False, error=ExecutionError( type="NotImplementedError", message="Step operations require DAP integration (set useDap=true when creating session)", ), ) if not session.dap_wrapper: return BreakpointResponse( hit=False, completed=False, error=ExecutionError( type="SessionError", message="DAP session not initialized", ), ) if session.status != SessionStatus.PAUSED: return BreakpointResponse( hit=False, completed=False, error=ExecutionError( type="InvalidStateError", message=f"Cannot step from state: {session.status}. Must be PAUSED.", ), ) session.update_status(SessionStatus.RUNNING) with Timer() as timer: try: response = session.dap_wrapper.step_in(timeout=DEFAULT_TIMEOUT_SECONDS) # Update session state if response.hit: session.update_status(SessionStatus.PAUSED) if response.frameInfo: session.update_breakpoint(response.frameInfo.file, response.frameInfo.line) elif response.completed: session.update_status(SessionStatus.COMPLETED) elif response.error: session.update_status(SessionStatus.ERROR) session.update_timings(timer.elapsed_ms) return response except Exception as e: session.update_status(SessionStatus.ERROR) return BreakpointResponse( hit=False, completed=False, error=ExecutionError( type=type(e).__name__, message=str(e), ), )
  • Async wrapper that delegates to synchronous step_in method for MCP SDK compatibility.
    async def step_in_async(self, session_id: str) -> BreakpointResponse: """ Async wrapper for step_in. Runs the synchronous step_in in a thread pool to avoid blocking. """ return await asyncio.to_thread(self.step_in, session_id)

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/Kaina3/Debug-MCP'

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