Skip to main content
Glama
ThinkFar

Clear Thought Server

programmingparadigm

Apply programming paradigms to solve coding problems by selecting approaches like functional, object-oriented, or reactive programming for structured solutions.

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

TableJSON Schema
NameRequiredDescriptionDefault
paradigmNameYes
problemYes
approachNo
benefitsNo
limitationsNo
codeExampleNo
languagesNo

Implementation Reference

  • Main execution logic for the 'programmingparadigm' tool, processing input, validating, formatting output, and returning structured JSON response.
    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
        };
      }
    }
  • Tool definition including name, description, and detailed 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:1070-1082 (registration)
    MCP server request handler registration that dispatches 'programmingparadigm' tool calls to the paradigmServer.processParadigm method.
    case "programmingparadigm": {
        const result = paradigmServer.processParadigm(
            request.params.arguments
        );
        return {
            content: [
                {
                    type: "text",
                    text: JSON.stringify(result, null, 2),
                },
            ],
        };
    }
  • TypeScript interface defining the data structure for programming paradigm inputs, used in validation.
    export interface ProgrammingParadigmData {
        paradigmName: string;
        problem: string;
        approach: string[];
        benefits: string[];
        limitations: string[];
        codeExample?: string;
        languages?: string[];
    }
  • Helper function for input validation and type casting to ProgrammingParadigmData.
    private validateParadigmData(input: unknown): ProgrammingParadigmData {
      const data = input as Record<string, unknown>;
    
      if (!data.paradigmName || typeof data.paradigmName !== 'string') {
        throw new Error('Invalid paradigmName: must be a string');
      }
      if (!data.problem || typeof data.problem !== 'string') {
        throw new Error('Invalid problem: must be a string');
      }
    
      return {
        paradigmName: data.paradigmName as string,
        problem: data.problem as string,
        approach: Array.isArray(data.approach) ? data.approach.map(String) : [],
        benefits: Array.isArray(data.benefits) ? data.benefits.map(String) : [],
        limitations: Array.isArray(data.limitations) ? data.limitations.map(String) : [],
        codeExample: typeof data.codeExample === 'string' ? data.codeExample as string : undefined,
        languages: Array.isArray(data.languages) ? data.languages.map(String) : undefined
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose what the tool does (e.g., generates explanations, provides code snippets, compares paradigms), how it handles inputs/outputs, or any constraints like rate limits or authentication needs. The phrase 'applying different programming paradigms' is too abstract to infer concrete behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the main purpose in the first sentence, followed by a bulleted list of paradigms and a concluding sentence. There's no wasted text, though it could be more specific to enhance clarity without adding bulk.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 7 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, how parameters interact, or the complexity involved in applying paradigms, making it inadequate for an agent to use the tool effectively without guesswork.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but fails to do so. It lists paradigm names but doesn't explain parameters like 'problem', 'approach', 'benefits', 'limitations', 'codeExample', or 'languages', leaving their purposes and formats unclear. The description adds minimal value beyond the enum for 'paradigmName'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'applies different programming paradigms to solve problems' and lists supported paradigms, which gives a general purpose. However, it's vague about what 'applying' entails (e.g., generating code, explaining concepts, comparing paradigms) and doesn't differentiate from siblings like 'designpattern' or 'structuredargumentation' that might also involve problem-solving approaches.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't specify scenarios where programming paradigms are appropriate (e.g., for coding tasks vs. theoretical discussions) or mention sibling tools, leaving the agent to guess based on context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/ThinkFar/clear-thought-mcp'

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