Skip to main content
Glama

sessions_step_over

Execute code line-by-line during debugging to skip function calls and continue to the next line in the current function, helping developers analyze program flow without entering nested functions.

Instructions

Step over the current line (requires active breakpoint)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe debug session ID

Implementation Reference

  • The primary handler function for the 'sessions_step_over' MCP tool. It validates the sessionId argument, delegates to SessionManager.step_over_async, serializes the response to JSON, and returns it as TextContent. Handles SessionNotFound and general exceptions by returning error responses.
    async def _handle_sessions_step_over(self, arguments: dict) -> list[TextContent]: """ Handler for sessions_step_over tool. Steps over the current line. """ 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_over_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_over") return [ TextContent( type="text", text=json.dumps({ "error": { "type": type(e).__name__, "message": str(e), } }), ) ]
  • The schema definition for the 'sessions_step_over' tool, registered via list_tools(). Specifies the tool name, description, and input schema requiring a 'sessionId' string.
    Tool( name="sessions_step_over", description="Step over the current line (requires active breakpoint)", inputSchema={ "type": "object", "properties": { "sessionId": { "type": "string", "description": "The debug session ID", }, }, "required": ["sessionId"], }, ),
  • The dispatch registration in the call_tool handler that routes 'sessions_step_over' calls to the specific _handle_sessions_step_over method.
    elif name == "sessions_step_over": return await self._handle_sessions_step_over(arguments)
  • Supporting method in SessionManager that implements the step-over logic using the DAP wrapper. Checks prerequisites (DAP enabled, paused state), performs the step_over via dap_wrapper, updates session state, and returns BreakpointResponse.
    def step_over(self, session_id: str) -> BreakpointResponse: """ Step over the current line (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_over(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 enables the synchronous step_over method to be called awaitably from the MCP server handler.
    async def step_over_async(self, session_id: str) -> BreakpointResponse: """ Async wrapper for step_over. Runs the synchronous step_over in a thread pool to avoid blocking. """ return await asyncio.to_thread(self.step_over, 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