ultra-challenge
Analyze statements critically to identify assumptions and prevent reflexive agreement using AI-powered questioning.
Instructions
Challenges a statement or assumption with critical thinking to prevent reflexive agreement
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The statement, assumption, or proposal to analyze critically | |
| provider | No | AI provider to use for critical analysis (optional, defaults to best available) | |
| model | No | Specific model to use (optional) | |
| sessionId | No | Session ID for conversation context (optional) |
Implementation Reference
- src/server.ts:968-975 (registration)Registers the 'ultra-challenge' tool, specifying title, description, input schema, and an inline handler that delegates to handleChallenge function.server.registerTool("ultra-challenge", { title: "Zen Challenge", description: "Challenges a statement or assumption with critical thinking to prevent reflexive agreement", inputSchema: ZenChallengeSchema.shape, }, async (args) => { const provider = await getProviderManager(); return await handleChallenge(args, provider) as any; });
- src/server.ts:148-153 (schema)Defines the input schema (ZenChallengeSchema) for the ultra-challenge tool using Zod validation.const ZenChallengeSchema = z.object({ prompt: z.string().describe("The statement, assumption, or proposal to analyze critically"), provider: z.enum(["openai", "gemini", "azure", "grok", "openai-compatible"]).optional().describe("AI provider to use for critical analysis (optional, defaults to best available)"), model: z.string().optional().describe("Specific model to use (optional)"), sessionId: z.string().optional().describe("Session ID for conversation context (optional)"), });
- src/handlers/ultra-tools.ts:146-218 (handler)The main handler function for 'ultra-challenge' tool. It constructs a critical thinking prompt, optionally loads session context, generates AI response using provider, saves to session if applicable, and returns formatted content.export async function handleChallenge(args: any, providerManager: ProviderManager) { const { prompt, provider, model, sessionId } = args; // Wrap the prompt with critical thinking instructions const challengePrompt = `You are asked to critically analyze the following statement or assumption. Your goal is to provide honest, thoughtful analysis rather than automatic agreement. Instructions: - Challenge assumptions if they seem questionable - Point out potential flaws, limitations, or alternative perspectives - Ask clarifying questions if the statement is unclear - Provide evidence-based reasoning for your analysis - If you disagree, explain why clearly and constructively - If you agree, explain your reasoning and any caveats DO NOT simply agree to be agreeable. Your role is to provide honest, critical evaluation. Statement to analyze: ${prompt} Provide your critical analysis:`; // Get conversation context if sessionId provided let conversationContext = ''; if (sessionId) { try { const context = await conversationMemory.getConversationContext(sessionId, 4000, true); if (context.messages.length > 0) { conversationContext = '\n\nPrevious conversation context:\n' + context.messages.slice(-5).map(m => `${m.role}: ${m.content}`).join('\n'); } } catch (error) { console.warn('Failed to load conversation context:', error); } } const finalPrompt = challengePrompt + conversationContext; // Use provider manager to get response const aiProvider = await providerManager.getProvider(provider); const result = await aiProvider.generateText({ prompt: finalPrompt, model: model || aiProvider.getDefaultModel(), temperature: 0.7, useSearchGrounding: false, }); // Save to conversation if sessionId provided if (sessionId) { try { await conversationMemory.getOrCreateSession(sessionId); await conversationMemory.addMessage(sessionId, 'user', prompt, 'challenge'); await conversationMemory.addMessage( sessionId, 'assistant', result.text, 'challenge', undefined, { provider, model: result.model } ); } catch (error) { console.warn('Failed to save to conversation:', error); } } return { content: [ { type: 'text', text: `## Critical Analysis\n\n${result.text}\n\n---\n*Analysis provided by ${result.model} via critical thinking prompt to prevent reflexive agreement.*` } ] }; }