programmingparadigm
Explore and apply diverse programming paradigms to solve coding challenges. Supports imperative, procedural, object-oriented, functional, declarative, logic, event-driven, aspect-oriented, concurrent, and reactive approaches for structured problem-solving.
Instructions
A tool for applying different programming paradigms to solve problems. Supports various programming paradigms including:
Imperative Programming
Procedural Programming
Object-Oriented Programming
Functional Programming
Declarative Programming
Logic Programming
Event-Driven Programming
Aspect-Oriented Programming
Concurrent Programming
Reactive Programming
Each paradigm provides a different approach to structuring and executing code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| approach | No | ||
| benefits | No | ||
| codeExample | No | ||
| languages | No | ||
| limitations | No | ||
| paradigmName | Yes | ||
| problem | Yes |
Implementation Reference
- The core handler method that validates input, formats the paradigm output for console, and returns a structured JSON response indicating success or error.public processParadigm(input: unknown): { content: Array<{ type: string; text: string }>; isError?: boolean } { try { const validatedInput = this.validateParadigmData(input); const formattedOutput = this.formatParadigmOutput(validatedInput); console.error(formattedOutput); return { content: [{ type: "text", text: JSON.stringify({ paradigmName: validatedInput.paradigmName, status: 'success', hasApproach: validatedInput.approach.length > 0, hasCodeExample: !!validatedInput.codeExample }, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: error instanceof Error ? error.message : String(error), status: 'failed' }, null, 2) }], isError: true }; } }
- src/models/interfaces.ts:37-45 (schema)TypeScript interface defining the structure of ProgrammingParadigmData used for input validation in the tool handler.export interface ProgrammingParadigmData { paradigmName: string; problem: string; approach: string[]; benefits: string[]; limitations: string[]; codeExample?: string; languages?: string[]; }
- src/index.ts:117-172 (registration)Defines the MCP Tool object including name, description, and inputSchema for the programmingparadigm tool.const PROGRAMMING_PARADIGM_TOOL: Tool = { name: "programmingparadigm", description: `A tool for applying different programming paradigms to solve problems. Supports various programming paradigms including: - Imperative Programming - Procedural Programming - Object-Oriented Programming - Functional Programming - Declarative Programming - Logic Programming - Event-Driven Programming - Aspect-Oriented Programming - Concurrent Programming - Reactive Programming Each paradigm provides a different approach to structuring and executing code.`, inputSchema: { type: "object", properties: { paradigmName: { type: "string", enum: [ "imperative", "procedural", "object_oriented", "functional", "declarative", "logic", "event_driven", "aspect_oriented", "concurrent", "reactive", ], }, problem: { type: "string" }, approach: { type: "array", items: { type: "string" }, }, benefits: { type: "array", items: { type: "string" }, }, limitations: { type: "array", items: { type: "string" }, }, codeExample: { type: "string" }, languages: { type: "array", items: { type: "string" }, }, }, required: ["paradigmName", "problem"], }, };
- src/index.ts:996-1010 (registration)Registers the programmingparadigm tool in the MCP server capabilities.capabilities: { tools: { sequentialthinking: SEQUENTIAL_THINKING_TOOL, mentalmodel: MENTAL_MODEL_TOOL, designpattern: DESIGN_PATTERN_TOOL, programmingparadigm: PROGRAMMING_PARADIGM_TOOL, debuggingapproach: DEBUGGING_APPROACH_TOOL, collaborativereasoning: COLLABORATIVE_REASONING_TOOL, decisionframework: DECISION_FRAMEWORK_TOOL, metacognitivemonitoring: METACOGNITIVE_MONITORING_TOOL, scientificmethod: SCIENTIFIC_METHOD_TOOL, structuredargumentation: STRUCTURED_ARGUMENTATION_TOOL, visualreasoning: VISUAL_REASONING_TOOL, }, },
- src/index.ts:1070-1082 (handler)MCP request handler switch case that invokes the paradigmServer.processParadigm method and formats the response.case "programmingparadigm": { const result = paradigmServer.processParadigm( request.params.arguments ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }