Skip to main content
Glama

continue_execution

Resume program execution after hitting a breakpoint in Python, JavaScript, or Rust debugging sessions.

Instructions

Continue execution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYes

Implementation Reference

  • src/server.ts:476-476 (registration)
    Registration of the 'continue_execution' tool in the ListToolsRequestSchema handler, including its input schema requiring sessionId.
    { name: 'continue_execution', description: 'Continue execution', inputSchema: { type: 'object', properties: { sessionId: { type: 'string' } }, required: ['sessionId'] } },
  • Primary MCP tool handler for 'continue_execution' in the CallToolRequestSchema switch statement. Validates sessionId, calls continueExecution, formats success/error response.
    case 'continue_execution': {
      if (!args.sessionId) {
        throw new McpError(McpErrorCode.InvalidParams, 'Missing required sessionId');
      }
      
      try {
        const continueResult = await this.continueExecution(args.sessionId);
        result = { content: [{ type: 'text', text: JSON.stringify({ success: continueResult, message: continueResult ? 'Continued execution' : 'Failed to continue execution' }) }] };
      } catch (error) {
        // Handle validation errors specifically
        if (error instanceof SessionTerminatedError ||
            error instanceof SessionNotFoundError ||
            error instanceof ProxyNotRunningError) {
          result = { content: [{ type: 'text', text: JSON.stringify({ success: false, error: error.message }) }] };
        } else if (error instanceof Error) {
          // Handle other expected errors
          result = { content: [{ type: 'text', text: JSON.stringify({ success: false, error: error.message }) }] };
        } else {
          // Re-throw unexpected errors
          throw error;
        }
      }
      break;
  • Helper method continueExecution that validates the session and delegates to SessionManager.continue(), throwing on failure.
    public async continueExecution(sessionId: string): Promise<boolean> {
      this.validateSession(sessionId);
      const result = await this.sessionManager.continue(sessionId);
      if (!result.success) {
        throw new Error(result.error || 'Failed to continue execution');
      }
      return true;
    }
  • Core implementation of continue operation: validates session is paused and has threadId, sends DAP 'continue' request to the debug proxy, updates session state to RUNNING.
    async continue(sessionId: string): Promise<DebugResult> {
      const session = this._getSessionById(sessionId);
    
      // Check if session is terminated
      if (session.sessionLifecycle === SessionLifecycleState.TERMINATED) {
        throw new SessionTerminatedError(sessionId);
      }
    
      const threadId = session.proxyManager?.getCurrentThreadId();
      this.logger.info(
        `[SessionManager continue] Called for session ${sessionId}. Current state: ${session.state}, ThreadID: ${threadId}`
      );
    
      if (!session.proxyManager || !session.proxyManager.isRunning()) {
        throw new ProxyNotRunningError(sessionId, 'continue');
      }
      if (session.state !== SessionState.PAUSED) {
        this.logger.warn(
          `[SessionManager continue] Session ${sessionId} not paused. State: ${session.state}.`
        );
        return { success: false, error: 'Not paused', state: session.state };
      }
      if (typeof threadId !== 'number') {
        this.logger.warn(
          `[SessionManager continue] No current thread ID for session ${sessionId}.`
        );
        return { success: false, error: 'No current thread ID', state: session.state };
      }
    
      try {
        this.logger.info(
          `[SessionManager continue] Sending DAP 'continue' for session ${sessionId}, threadId ${threadId}.`
        );
        await session.proxyManager.sendDapRequest('continue', { threadId });
    
        if (session.state === SessionState.PAUSED || session.state === SessionState.STOPPED) {
          this.logger.debug(
            `[SessionManager continue] DAP 'continue' completed but session ${sessionId} is already ${session.state}; skipping RUNNING update.`
          );
        } else {
          this._updateSessionState(session, SessionState.RUNNING);
          this.logger.info(
            `[SessionManager continue] DAP 'continue' sent, session ${sessionId} state updated to RUNNING.`
          );
        }
        return { success: true, state: session.state };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        this.logger.error(
          `[SessionManager continue] Error sending 'continue' to proxy for session ${sessionId}: ${errorMessage}`
        );
        throw error;
      }
    }

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/debugmcpdev/mcp-debugger'

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