Skip to main content
Glama

sessions_continue

Continue Python debugging execution to the next breakpoint using the Debug Adapter Protocol. Resume paused sessions to advance through code step-by-step for interactive debugging.

Instructions

Continue execution to the next breakpoint

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe debug session ID
fileYesProject-relative file path
lineYesLine number (1-based)

Implementation Reference

  • MCP tool handler for 'sessions_continue': validates arguments, creates ContinueRequest (converted to BreakpointRequest), calls SessionManager.continue_execution_async, and returns JSON response or error.
    async def _handle_sessions_continue(self, arguments: dict) -> list[TextContent]: """ Handler for sessions_continue tool. Continues execution to the next breakpoint. """ try: session_id = arguments.get("sessionId") if not session_id: return [ TextContent( type="text", text=json.dumps({ "error": { "type": "ValueError", "message": "sessionId is required", } }), ) ] request = ContinueRequest( file=arguments["file"], line=arguments["line"], ) # Convert to BreakpointRequest (they have same structure) bp_request = BreakpointRequest( file=request.file, line=request.line, ) response = await self.session_manager.continue_execution_async( session_id, bp_request ) 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 continuing execution") return [ TextContent( type="text", text=json.dumps({ "error": { "type": type(e).__name__, "message": str(e), } }), ) ]
  • Registration of the 'sessions_continue' tool in list_tools(), including name, description, and input schema matching ContinueRequest.
    Tool( name="sessions_continue", description="Continue execution to the next breakpoint", inputSchema={ "type": "object", "properties": { "sessionId": { "type": "string", "description": "The debug session ID", }, "file": { "type": "string", "description": "Project-relative file path", }, "line": { "type": "integer", "description": "Line number (1-based)", "minimum": 1, }, }, "required": ["sessionId", "file", "line"], }, ),
  • Pydantic model defining the input schema for sessions_continue tool (ContinueRequest). Note: handler converts it to BreakpointRequest internally.
    class ContinueRequest(BaseModel): """Request to continue to next breakpoint.""" file: str = Field(..., description="Project-relative path to file") line: int = Field(..., ge=1, description="1-based line number")
  • Core logic in SessionManager.continue_execution: validates session state (must be PAUSED), resolves breakpoint path, delegates to DAP or legacy BDB implementation for continuing execution.
    def continue_execution( self, session_id: str, request: BreakpointRequest ) -> BreakpointResponse: """ Continue execution to next breakpoint within same session. Args: session_id: Session ID request: Breakpoint request with file and line Returns: Breakpoint response with locals at next breakpoint Raises: KeyError: If session not found ValueError: If file/line is invalid """ session = self.get_session(session_id) # Validate breakpoint location using session's workspace root breakpoint_path = resolve_workspace_path(session.workspace_root, request.file) validate_file_and_line(breakpoint_path, request.line) # Session must be paused (from previous breakpoint) if session.status != SessionStatus.PAUSED: return BreakpointResponse( hit=False, completed=False, error=ExecutionError( type="InvalidStateError", message=f"Cannot continue from state: {session.status}", ), ) # Use DAP if enabled (default) if session.use_dap: return self._continue_execution_dap(session, breakpoint_path, request.line) else: return self._continue_execution_bdb(session, breakpoint_path, request.line)
  • DAP-specific continuation logic (_continue_execution_dap): calls dap_wrapper.run_to_breakpoint to continue to next breakpoint, updates session state and timings.
    def _continue_execution_dap( self, session: DebugSession, breakpoint_path: Path, line: int ) -> BreakpointResponse: """Continue execution using DAP.""" if not session.dap_wrapper: return BreakpointResponse( hit=False, completed=False, error=ExecutionError( type="SessionError", message="DAP session not initialized", ), ) session.update_status(SessionStatus.RUNNING) with Timer() as timer: try: # For DAP, continue to next breakpoint uses run_to_breakpoint # (DAP manages the execution state internally) response = session.dap_wrapper.run_to_breakpoint( str(breakpoint_path), line, timeout=DEFAULT_TIMEOUT_SECONDS, ) # Update session state if response.hit: session.update_breakpoint(str(breakpoint_path), line) session.update_status(SessionStatus.PAUSED) 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), ), )

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