Skip to main content
Glama
setConfirmationFlags.ts2.38 kB
/** * Operations for setting user confirmation and analysis completion flags * * This module provides functions to update the userConfirmation and analysisComplete * flags in the wizard state. */ import { createErrorResult, createSuccessResult } from '../mcp/utils' import type { StateManager } from '../stateManager' /** * Options for the setAnalysisComplete function */ export interface AnalysisCompleteOptions { isComplete: boolean } /** * Set the analysis complete flag in the wizard state */ export function setAnalysisComplete( stateManager: StateManager, options: AnalysisCompleteOptions, ): ReturnType<typeof createSuccessResult | typeof createErrorResult> { try { const stateResult = stateManager.getState() if (!stateResult.success) { return createErrorResult('No active wizard session found') } // We only need to check if state exists, not use it const updatedState = { analysisComplete: options.isComplete, } const setResult = stateManager.updateState(updatedState) if (!setResult.success) { return createErrorResult(`Failed to update state: ${setResult.error.message}`) } return createSuccessResult({ message: `Analysis status updated to: ${options.isComplete}`, }) } catch (error) { return createErrorResult(`Failed to update analysis status: ${(error as Error).message}`) } } /** * Options for the setUserConfirmation function */ export interface UserConfirmationOptions { confirmed: boolean } /** * Set the user confirmation flag in the wizard state */ export function setUserConfirmation( stateManager: StateManager, options: UserConfirmationOptions, ): ReturnType<typeof createSuccessResult | typeof createErrorResult> { try { const stateResult = stateManager.getState() if (!stateResult.success) { return createErrorResult('No active wizard session found') } // We only need to check if state exists, not use it const updatedState = { userConfirmation: options.confirmed, } const setResult = stateManager.updateState(updatedState) if (!setResult.success) { return createErrorResult(`Failed to update state: ${setResult.error.message}`) } return createSuccessResult({ message: `User confirmation updated to: ${options.confirmed}`, }) } catch (error) { return createErrorResult(`Failed to update user confirmation: ${(error as Error).message}`) } }

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/tbreeding/jira-mcp'

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