Skip to main content
Glama

brainstorm_enhancements

Generate creative ideas to improve concepts, products, or features by focusing on innovation, feasibility, and user value.

Instructions

Generates creative ideas for improving a given concept, product, or feature, focusing on innovation, feasibility, and user value.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conceptYesA description of the concept, product, or feature to enhance

Implementation Reference

  • The main handler function that implements the core logic of the 'brainstorm_enhancements' tool. It handles input validation, rate limiting, prompt generation using predefined templates, makes an API call to Deepseek, and formats the response.
    export async function handler(args: unknown): Promise<ToolResponse> {
      // Check rate limit first
      if (!checkRateLimit()) {
        return {
          content: [
            {
              type: 'text',
              text: 'Rate limit exceeded. Please try again later.',
            },
          ],
          isError: true,
        };
      }
    
      // Validate arguments
      if (!args || typeof args !== 'object') {
        return {
          content: [
            {
              type: 'text',
              text: 'Invalid arguments provided.',
            },
          ],
          isError: true,
        };
      }
    
      try {
        // Type guard for BrainstormEnhancementsArgs
        if (!('concept' in args) || typeof args.concept !== 'string') {
          return {
            content: [
              {
                type: 'text',
                text: 'Concept parameter is required and must be a string.',
              },
            ],
            isError: true,
          };
        }
    
        const typedArgs = args as BrainstormEnhancementsArgs;
    
        // Sanitize input
        const sanitizedConcept = sanitizeInput(typedArgs.concept);
    
        // Create the complete prompt
        const prompt = createPrompt(PROMPT_TEMPLATE, {
          concept: sanitizedConcept,
        });
    
        // Make the API call
        const response = await makeDeepseekAPICall(prompt, SYSTEM_PROMPT);
    
        if (response.isError) {
          return {
            content: [
              {
                type: 'text',
                text: `Error generating enhancement ideas: ${response.errorMessage || 'Unknown error'}`,
              },
            ],
            isError: true,
          };
        }
    
        // Return the formatted response
        return {
          content: [
            {
              type: 'text',
              text: response.text,
            },
          ],
        };
      } catch (error) {
        console.error('Brainstorm enhancements tool error:', error);
        return {
          content: [
            {
              type: 'text',
              text: `Error processing enhancement ideas: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • The ToolDefinition object defining the tool's name, description, and input schema (requires 'concept' string).
    export const definition: ToolDefinition = {
      name: 'brainstorm_enhancements',
      description: 'Generates creative ideas for improving a given concept, product, or feature, focusing on innovation, feasibility, and user value.',
      inputSchema: {
        type: 'object',
        properties: {
          concept: {
            type: 'string',
            description: 'A description of the concept, product, or feature to enhance',
          },
        },
        required: ['concept'],
      },
    };
  • TypeScript interface defining the expected input arguments for the tool.
    export interface BrainstormEnhancementsArgs {
      concept: string;
    }
  • src/server.ts:56-64 (registration)
    Registers the tool's definition in the listTools handler, making it discoverable by clients.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        secondOpinion.definition,
        codeReview.definition,
        designCritique.definition,
        writingFeedback.definition,
        brainstormEnhancements.definition,
      ],
    }));
  • src/server.ts:125-134 (registration)
    Handles incoming callTool requests for 'brainstorm_enhancements' by validating args and invoking the tool handler.
    case "brainstorm_enhancements": {
      if (!isBrainstormEnhancementsArgs(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Invalid parameters for brainstorm enhancements"
        );
      }
      response = await brainstormEnhancements.handler(args);
      break;
    }

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/cyanheads/mentor-mcp-server'

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