Skip to main content
Glama

brainstorm

Generate creative ideas using structured frameworks with domain context and feasibility analysis to solve brainstorming challenges.

Instructions

Generate creative ideas using structured frameworks with domain context and feasibility analysis.

Input Schema

NameRequiredDescriptionDefault
promptYesBrainstorming challenge or question
modelNoModel: gpt-5-codex (default), gpt-5, o3, o4-mini, codex-1, codex-mini-latest, gpt-4.1
approvalPolicyNoApproval: never, on-request, on-failure, untrusted
sandboxModeNoAccess: read-only, workspace-write, danger-full-access
fullAutoNoFull automation mode
yoloNo⚠️ Bypass all safety (dangerous)
cdNoWorking directory
methodologyNoFramework: divergent, convergent, scamper, design-thinking, lateral, auto (default)auto
domainNoDomain: software, business, creative, research, product, marketing, etc.
constraintsNoLimitations: budget, time, technical, legal, etc.
existingContextNoBackground info or previous attempts
ideaCountNoNumber of ideas (default: 12, range: 5-30)
includeAnalysisNoInclude feasibility/impact analysis
searchNoEnable web search for research (activates web_search_request feature)
ossNoUse local Ollama server
enableFeaturesNoEnable feature flags
disableFeaturesNoDisable feature flags

Input Schema (JSON Schema)

{ "properties": { "approvalPolicy": { "description": "Approval: never, on-request, on-failure, untrusted", "enum": [ "never", "on-request", "on-failure", "untrusted" ], "type": "string" }, "cd": { "description": "Working directory", "type": "string" }, "constraints": { "description": "Limitations: budget, time, technical, legal, etc.", "type": "string" }, "disableFeatures": { "description": "Disable feature flags", "items": { "type": "string" }, "type": "array" }, "domain": { "description": "Domain: software, business, creative, research, product, marketing, etc.", "type": "string" }, "enableFeatures": { "description": "Enable feature flags", "items": { "type": "string" }, "type": "array" }, "existingContext": { "description": "Background info or previous attempts", "type": "string" }, "fullAuto": { "description": "Full automation mode", "type": "boolean" }, "ideaCount": { "default": 12, "description": "Number of ideas (default: 12, range: 5-30)", "exclusiveMinimum": 0, "type": "integer" }, "includeAnalysis": { "default": true, "description": "Include feasibility/impact analysis", "type": "boolean" }, "methodology": { "default": "auto", "description": "Framework: divergent, convergent, scamper, design-thinking, lateral, auto (default)", "enum": [ "divergent", "convergent", "scamper", "design-thinking", "lateral", "auto" ], "type": "string" }, "model": { "description": "Model: gpt-5-codex (default), gpt-5, o3, o4-mini, codex-1, codex-mini-latest, gpt-4.1", "type": "string" }, "oss": { "description": "Use local Ollama server", "type": "boolean" }, "prompt": { "description": "Brainstorming challenge or question", "minLength": 1, "type": "string" }, "sandboxMode": { "description": "Access: read-only, workspace-write, danger-full-access", "enum": [ "read-only", "workspace-write", "danger-full-access" ], "type": "string" }, "search": { "description": "Enable web search for research (activates web_search_request feature)", "type": "boolean" }, "yolo": { "description": "⚠️ Bypass all safety (dangerous)", "type": "boolean" } }, "required": [ "prompt" ], "type": "object" }

Implementation Reference

  • The main handler function for the 'brainstorm' tool. Validates input, builds an enhanced prompt using helpers, logs debug info, reports progress, and executes via Codex CLI.
    execute: async (args, onProgress) => { const { prompt, model, approvalPolicy, sandboxMode, fullAuto, yolo, cd, methodology = 'auto', domain, constraints, existingContext, ideaCount = 12, includeAnalysis = true, search, oss, enableFeatures, disableFeatures, } = args; if (!prompt?.trim()) { throw new Error('You must provide a valid brainstorming challenge or question to explore'); } let enhancedPrompt = buildBrainstormPrompt({ prompt: prompt.trim() as string, methodology: methodology as string, domain: domain as string | undefined, constraints: constraints as string | undefined, existingContext: existingContext as string | undefined, ideaCount: ideaCount as number, includeAnalysis: includeAnalysis as boolean, }); Logger.debug( `Brainstorm: Using methodology '${methodology}' for domain '${domain || 'general'}'` ); // Report progress to user onProgress?.(`Generating ${ideaCount} ideas via ${methodology} methodology...`); // Execute with Codex (non-interactive) return await executeCodexCLI( enhancedPrompt, { model: model as string | undefined, fullAuto: Boolean(fullAuto), approvalPolicy: approvalPolicy as any, sandboxMode: sandboxMode as any, yolo: Boolean(yolo), cd: cd as string | undefined, search: search as boolean, oss: oss as boolean, enableFeatures: enableFeatures as string[], disableFeatures: disableFeatures as string[], }, onProgress ); }, };
  • Zod schema defining all input parameters for the brainstorm tool, including prompt, model options, methodology, domain, constraints, idea count, and various execution flags.
    const brainstormArgsSchema = z.object({ prompt: z.string().min(1).describe('Brainstorming challenge or question'), model: z .string() .optional() .describe( 'Model: gpt-5-codex (default), gpt-5, o3, o4-mini, codex-1, codex-mini-latest, gpt-4.1' ), approvalPolicy: z .enum(['never', 'on-request', 'on-failure', 'untrusted']) .optional() .describe('Approval: never, on-request, on-failure, untrusted'), sandboxMode: z .enum(['read-only', 'workspace-write', 'danger-full-access']) .optional() .describe('Access: read-only, workspace-write, danger-full-access'), fullAuto: z.boolean().optional().describe('Full automation mode'), yolo: z.boolean().optional().describe('⚠️ Bypass all safety (dangerous)'), cd: z.string().optional().describe('Working directory'), methodology: z .enum(['divergent', 'convergent', 'scamper', 'design-thinking', 'lateral', 'auto']) .default('auto') .describe( 'Framework: divergent, convergent, scamper, design-thinking, lateral, auto (default)' ), domain: z .string() .optional() .describe('Domain: software, business, creative, research, product, marketing, etc.'), constraints: z.string().optional().describe('Limitations: budget, time, technical, legal, etc.'), existingContext: z.string().optional().describe('Background info or previous attempts'), ideaCount: z .number() .int() .positive() .default(12) .describe('Number of ideas (default: 12, range: 5-30)'), includeAnalysis: z.boolean().default(true).describe('Include feasibility/impact analysis'), search: z .boolean() .optional() .describe('Enable web search for research (activates web_search_request feature)'), oss: z.boolean().optional().describe('Use local Ollama server'), enableFeatures: z.array(z.string()).optional().describe('Enable feature flags'), disableFeatures: z.array(z.string()).optional().describe('Disable feature flags'), });
  • Registers the 'brainstorm' tool (along with others) by pushing it into the central toolRegistry array.
    toolRegistry.push( askCodexTool, batchCodexTool, // reviewCodexTool, pingTool, helpTool, versionTool, brainstormTool, fetchChunkTool, timeoutTestTool );
  • Helper function that builds the structured brainstorming prompt using the provided config, incorporating methodology instructions, context, and formatting requirements.
    function buildBrainstormPrompt(config: { prompt: string; methodology: string; domain?: string; constraints?: string; existingContext?: string; ideaCount: number; includeAnalysis: boolean; }): string { const { prompt, methodology, domain, constraints, existingContext, ideaCount, includeAnalysis } = config; // Select methodology framework let frameworkInstructions = getMethodologyInstructions(methodology, domain); let enhancedPrompt = `# BRAINSTORMING SESSION ## Challenge: ${prompt} ## Framework ${frameworkInstructions} ## Context ${domain ? `Domain: ${domain}` : ''} ${constraints ? `Constraints: ${constraints}` : ''} ${existingContext ? `Background: ${existingContext}` : ''} ## Requirements Generate ${ideaCount} actionable ideas. Keep descriptions concise (2-3 sentences max). ${ includeAnalysis ? `## Analysis Rate each: Feasibility (1-5), Impact (1-5), Innovation (1-5)` : '' } ## Format ### Idea [N]: [Name] Description: [2-3 sentences] ${includeAnalysis ? 'Ratings: F:[1-5] I:[1-5] N:[1-5]' : ''} Begin:`; return enhancedPrompt; }
  • Helper function providing methodology-specific instructions for different brainstorming frameworks (divergent, convergent, SCAMPER, etc.), with fallback to 'auto'.
    function getMethodologyInstructions(methodology: string, domain?: string): string { const methodologies: Record<string, string> = { divergent: `**Divergent Thinking Approach:** - Generate maximum quantity of ideas without self-censoring - Build on wild or seemingly impractical ideas - Combine unrelated concepts for unexpected solutions - Use "Yes, and..." thinking to expand each concept - Postpone evaluation until all ideas are generated`, convergent: `**Convergent Thinking Approach:** - Focus on refining and improving existing concepts - Synthesize related ideas into stronger solutions - Apply critical evaluation criteria - Prioritize based on feasibility and impact - Develop implementation pathways for top ideas`, scamper: `**SCAMPER Creative Triggers:** - **Substitute:** What can be substituted or replaced? - **Combine:** What can be combined or merged? - **Adapt:** What can be adapted from other domains? - **Modify:** What can be magnified, minimized, or altered? - **Put to other use:** How else can this be used? - **Eliminate:** What can be removed or simplified? - **Reverse:** What can be rearranged or reversed?`, 'design-thinking': `**Human-Centered Design Thinking:** - **Empathize:** Consider user needs, pain points, and contexts - **Define:** Frame problems from user perspective - **Ideate:** Generate user-focused solutions - **Consider Journey:** Think through complete user experience - **Prototype Mindset:** Focus on testable, iterative concepts`, lateral: `**Lateral Thinking Approach:** - Make unexpected connections between unrelated fields - Challenge fundamental assumptions - Use random word association to trigger new directions - Apply metaphors and analogies from other domains - Reverse conventional thinking patterns`, auto: `**AI-Optimized Approach:** ${domain ? `Given the ${domain} domain, I'll apply the most effective combination of:` : "I'll intelligently combine multiple methodologies:"} - Divergent exploration with domain-specific knowledge - SCAMPER triggers and lateral thinking - Human-centered perspective for practical value`, }; return methodologies[methodology] || methodologies['auto']; }

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/cexll/codex-mcp-server'

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