brainstorm_solutions
Generate multiple solution approaches for coding problems with pros and cons analysis to help developers evaluate options and make informed decisions.
Instructions
Generates multiple solution approaches for a problem, with pros/cons for each.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| problem | Yes | The problem to solve | |
| constraints | No | Constraints or requirements | |
| preferences | No | Preferred technologies or approaches |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"constraints": {
"description": "Constraints or requirements",
"items": {
"type": "string"
},
"type": "array"
},
"preferences": {
"description": "Preferred technologies or approaches",
"items": {
"type": "string"
},
"type": "array"
},
"problem": {
"description": "The problem to solve",
"type": "string"
}
},
"required": [
"problem"
],
"type": "object"
}
Implementation Reference
- src/tools/cognitive.ts:335-401 (handler)The core handler function for the 'brainstorm_solutions' tool. It takes problem, constraints, and preferences as input and generates a structured Markdown response outlining three solution approaches (Simple/Direct, Robust/Enterprise, Scalable/Distributed) with pros, cons, and recommendations.export function brainstormSolutionsHandler(args: any) { const { problem, constraints = [], preferences = [] } = args; const brainstorm = `# Brainstorm: ${problem} ## Constraints ${constraints.length > 0 ? constraints.map((c: string) => `- ${c}`).join("\n") : "None specified"} ## Preferences ${preferences.length > 0 ? preferences.map((p: string) => `- ${p}`).join("\n") : "None specified"} --- ## Solution Approaches ### Approach 1: Simple/Direct **Description**: Straightforward implementation **Pros**: - Quick to implement - Easy to understand - Low complexity **Cons**: - May not scale - Limited flexibility **Best for**: MVPs, prototypes, simple cases --- ### Approach 2: Robust/Enterprise **Description**: Production-ready with full error handling **Pros**: - Handles edge cases - Good error recovery - Maintainable **Cons**: - More code - Longer development time **Best for**: Production systems, critical paths --- ### Approach 3: Scalable/Distributed **Description**: Designed for growth and high load **Pros**: - Horizontal scaling - High availability - Future-proof **Cons**: - Complex infrastructure - Higher initial cost - Operational overhead **Best for**: High-traffic systems, microservices --- ## Recommendation Consider starting with Approach 1 and evolving toward Approach 2 as requirements solidify. `; return { content: [{ type: "text", text: brainstorm }] }; }
- src/tools/cognitive.ts:325-333 (schema)The Zod schema definition for the 'brainstorm_solutions' tool, defining the input structure: problem (required string), constraints and preferences (optional string arrays).export const brainstormSolutionsSchema = { name: "brainstorm_solutions", description: "Generates multiple solution approaches for a problem, with pros/cons for each.", inputSchema: z.object({ problem: z.string().describe("The problem to solve"), constraints: z.array(z.string()).optional().describe("Constraints or requirements"), preferences: z.array(z.string()).optional().describe("Preferred technologies or approaches") }) };
- src/index.ts:83-83 (registration)Registration of the 'brainstorm_solutions' tool in the main tool registry Map used by the stdio MCP server.["brainstorm_solutions", { schema: brainstormSolutionsSchema, handler: brainstormSolutionsHandler }],
- src/server.ts:93-93 (registration)Registration of the 'brainstorm_solutions' tool in the HTTP server's tool registry Map.["brainstorm_solutions", { schema: brainstormSolutionsSchema, handler: brainstormSolutionsHandler }],