Skip to main content
Glama

sessions_continue

Continue execution to the next breakpoint in a Python debugging session, allowing step-by-step code analysis through the Debug Adapter Protocol.

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

  • Primary MCP handler for 'sessions_continue' tool. Validates input, calls SessionManager.continue_execution_async, and formats response as JSON.
    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),
                        }
                    }),
                )
            ]
  • Tool registration in @server.list_tools(), including name, description, and JSON schema for input validation.
    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 ContinueRequest used in handler for input validation (matches MCP inputSchema).
    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 continue_execution logic in SessionManager: validates state, dispatches to DAP or legacy BDB implementation.
    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)
  • Async wrapper continue_execution_async called from MCP handler.
    async def continue_execution_async(
        self, session_id: str, request: BreakpointRequest
    ) -> BreakpointResponse:
        """
        Async wrapper for continue_execution.
        
        Runs the synchronous continue_execution in a thread pool to avoid blocking.
        """
        return await asyncio.to_thread(self.continue_execution, session_id, request)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but doesn't explain what happens during execution (e.g., whether it runs until a breakpoint is hit, what occurs if no breakpoint exists, or if it requires specific permissions). For a debug operation with potential side effects, this lack of detail is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It is front-loaded and easy to parse, making it highly concise and well-structured for quick comprehension by an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a debug operation (with no annotations and no output schema), the description is incomplete. It lacks details on behavioral outcomes, error conditions, or what the tool returns, which are critical for an agent to use it effectively. The high schema coverage doesn't compensate for these missing contextual elements.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting all three required parameters (sessionId, file, line). The description adds no additional parameter semantics beyond what the schema provides, such as explaining how these parameters interact during continuation. This meets the baseline for high schema coverage but doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Continue execution') and the target ('to the next breakpoint'), which is specific and unambiguous. It distinguishes itself from siblings like sessions_step_in/out/over by focusing on continuation to breakpoints rather than stepping through code. However, it doesn't explicitly mention debugging context, which is implied but could be more explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like sessions_step_in, sessions_step_over, or sessions_step_out. It doesn't mention prerequisites (e.g., requires an active debug session), nor does it clarify scenarios where continuing to a breakpoint is preferred over stepping. This leaves the agent without clear usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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