Skip to main content
Glama
ThinkFar

Clear Thought Server

metacognitivemonitoring

Systematically monitor knowledge boundaries, claim certainty, and reasoning biases to improve decision-making quality and track cognitive processes.

Instructions

A detailed tool for systematic self-monitoring of knowledge and reasoning quality. This tool helps models track knowledge boundaries, claim certainty, and reasoning biases. It provides a framework for metacognitive assessment across various domains and reasoning tasks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYes
stageYes
knowledgeAssessmentNo
claimsNo
reasoningStepsNo
overallConfidenceYes
uncertaintyAreasYes
recommendedApproachYes
monitoringIdYesUnique identifier for this monitoring session
iterationYesCurrent iteration of the monitoring process
suggestedAssessmentsNo
nextAssessmentNeededYesWhether further assessment is needed

Implementation Reference

  • Main handler method processMetacognitiveMonitoring that validates input, formats detailed output for console, and returns JSON status response.
    public processMetacognitiveMonitoring(input: unknown): { content: Array<{ type: string; text: string }>; isError?: boolean } {
      try {
        const validatedData = this.validateInputData(input);
        const formattedOutput = this.formatOutput(validatedData);
        console.error(formattedOutput);
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              task: validatedData.task,
              stage: validatedData.stage,
              monitoringId: validatedData.monitoringId,
              iteration: validatedData.iteration,
              overallConfidence: validatedData.overallConfidence,
              nextAssessmentNeeded: validatedData.nextAssessmentNeeded,
              status: 'success'
            }, 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
        };
      }
    }
  • Helper method validateInputData that checks required fields and validates data types and ranges.
    private validateInputData(input: unknown): MetacognitiveMonitoringData {
      const data = input as MetacognitiveMonitoringData;
      if (!data.task || !data.stage || !data.monitoringId) {
        throw new Error("Invalid input for MetacognitiveMonitoring: Missing required fields.");
      }
      if (typeof data.overallConfidence !== 'number' || data.overallConfidence < 0 || data.overallConfidence > 1) {
        throw new Error("Invalid overallConfidence value for MetacognitiveMonitoringData.");
      }
      if (typeof data.iteration !== 'number' || data.iteration < 0) {
        throw new Error("Invalid iteration value for MetacognitiveMonitoringData.");
      }
      if (typeof data.nextAssessmentNeeded !== 'boolean') {
        throw new Error("Invalid nextAssessmentNeeded value for MetacognitiveMonitoringData.");
      }
      return data;
    }
  • Helper method formatOutput that generates a richly formatted console output using chalk, covering all aspects of the monitoring data.
    private formatOutput(data: MetacognitiveMonitoringData): string {
      const { task, stage, overallConfidence, uncertaintyAreas, recommendedApproach, iteration } = data;
      
      let output = `\n${chalk.bold.blue('Metacognitive Monitoring')}\n`;
      output += `${chalk.bold.green('Task:')} ${task}\n`;
      output += `${chalk.bold.yellow('Stage:')} ${stage} (Iteration: ${iteration})\n`;
      output += `${chalk.bold.magenta('Overall Confidence:')} ${(overallConfidence * 100).toFixed(1)}%\n`;
      
      // Knowledge Assessment
      if (data.knowledgeAssessment) {
        const ka = data.knowledgeAssessment;
        output += `\n${chalk.bold.cyan('Knowledge Assessment:')}\n`;
        output += `${chalk.bold('Domain:')} ${ka.domain}\n`;
        output += `${chalk.bold('Level:')} ${ka.knowledgeLevel} (${(ka.confidenceScore * 100).toFixed(1)}% confidence)\n`;
        output += `${chalk.bold('Evidence:')} ${ka.supportingEvidence}\n`;
        
        if (ka.knownLimitations.length > 0) {
          output += `${chalk.bold('Known Limitations:')}\n`;
          ka.knownLimitations.forEach((limitation, i) => {
            output += `  ${chalk.bold(`${i+1}.`)} ${limitation}\n`;
          });
        }
      }
      
      // Claims
      if (data.claims && data.claims.length > 0) {
        output += `\n${chalk.bold.green('Claims:')}\n`;
        data.claims.forEach((claim, i) => {
          output += `${chalk.bold(`Claim ${i+1}:`)} ${claim.claim}\n`;
          output += `  ${chalk.bold('Status:')} ${claim.status} (${(claim.confidenceScore * 100).toFixed(1)}% confidence)\n`;
          output += `  ${chalk.bold('Evidence:')} ${claim.evidenceBasis}\n`;
          
          if (claim.alternativeInterpretations && claim.alternativeInterpretations.length > 0) {
            output += `  ${chalk.bold('Alternative Interpretations:')}\n`;
            claim.alternativeInterpretations.forEach((alt, j) => {
              output += `    ${chalk.bold(`${j+1}.`)} ${alt}\n`;
            });
          }
        });
      }
      
      // Reasoning Steps
      if (data.reasoningSteps && data.reasoningSteps.length > 0) {
        output += `\n${chalk.bold.yellow('Reasoning Steps:')}\n`;
        data.reasoningSteps.forEach((step, i) => {
          output += `${chalk.bold(`Step ${i+1}:`)} ${step.step}\n`;
          output += `  ${chalk.bold('Logical Validity:')} ${(step.logicalValidity * 100).toFixed(1)}%\n`;
          output += `  ${chalk.bold('Inference Strength:')} ${(step.inferenceStrength * 100).toFixed(1)}%\n`;
          
          if (step.assumptions.length > 0) {
            output += `  ${chalk.bold('Assumptions:')}\n`;
            step.assumptions.forEach((assumption, j) => {
              output += `    ${chalk.bold(`${j+1}.`)} ${assumption}\n`;
            });
          }
          
          if (step.potentialBiases.length > 0) {
            output += `  ${chalk.bold('Potential Biases:')}\n`;
            step.potentialBiases.forEach((bias, j) => {
              output += `    ${chalk.bold(`${j+1}.`)} ${bias}\n`;
            });
          }
        });
      }
      
      // Uncertainty Areas
      if (uncertaintyAreas.length > 0) {
        output += `\n${chalk.bold.red('Uncertainty Areas:')}\n`;
        uncertaintyAreas.forEach((area, i) => {
          output += `${chalk.bold(`${i+1}.`)} ${area}\n`;
        });
      }
      
      // Recommended Approach
      output += `\n${chalk.bold.cyan('Recommended Approach:')}\n${recommendedApproach}\n`;
      
      // Next Steps
      if (data.nextAssessmentNeeded) {
        output += `\n${chalk.green('Further assessment needed.')}\n`;
        if (data.suggestedAssessments && data.suggestedAssessments.length > 0) {
          output += `${chalk.bold('Suggested Assessments:')} ${data.suggestedAssessments.join(', ')}\n`;
        }
      } else {
        output += `\n${chalk.cyan('Assessment complete.')}\n`;
      }
      
      return output;
    }
  • TypeScript interface defining the structure of MetacognitiveMonitoringData, used for type safety and validation.
    export interface MetacognitiveMonitoringData {
        task: string;
        stage:
            | "knowledge-assessment"
            | "planning"
            | "execution"
            | "monitoring"
            | "evaluation"
            | "reflection";
        knowledgeAssessment?: KnowledgeAssessment;
        claims?: ClaimAssessment[];
        reasoningSteps?: ReasoningAssessment[];
        overallConfidence: number;
        uncertaintyAreas: string[];
        recommendedApproach: string;
        monitoringId: string;
        iteration: number;
        suggestedAssessments?: ("knowledge" | "claim" | "reasoning" | "overall")[];
        nextAssessmentNeeded: boolean;
    }
  • src/index.ts:1123-1136 (registration)
    Registration in the CallToolRequestHandler switch statement that routes calls to the metacognitiveMonitoringServer.processMetacognitiveMonitoring method.
    case "metacognitivemonitoring": {
        const result =
            metacognitiveMonitoringServer.processMetacognitiveMonitoring(
                request.params.arguments
            );
        return {
            content: [
                {
                    type: "text",
                    text: JSON.stringify(result, null, 2),
                },
            ],
        };
    }
  • src/index.ts:1005-1005 (registration)
    Tool registration in server capabilities.tools dictionary.
    metacognitivemonitoring: METACOGNITIVE_MONITORING_TOOL,
  • MCP Tool definition including name, description, and detailed inputSchema for JSON validation.
    const METACOGNITIVE_MONITORING_TOOL: Tool = {
        name: "metacognitivemonitoring",
        description: `A detailed tool for systematic self-monitoring of knowledge and reasoning quality.
    This tool helps models track knowledge boundaries, claim certainty, and reasoning biases.
    It provides a framework for metacognitive assessment across various domains and reasoning tasks.`,
        inputSchema: {
            type: "object",
            properties: {
                task: { type: "string" },
                stage: {
                    type: "string",
                    enum: [
                        "knowledge-assessment",
                        "planning",
                        "execution",
                        "monitoring",
                        "evaluation",
                        "reflection",
                    ],
                },
                knowledgeAssessment: {
                    type: "object",
                    properties: {
                        domain: { type: "string" },
                        knowledgeLevel: {
                            type: "string",
                            enum: [
                                "expert",
                                "proficient",
                                "familiar",
                                "basic",
                                "minimal",
                                "none",
                            ],
                        },
                        confidenceScore: { type: "number", minimum: 0, maximum: 1 },
                        supportingEvidence: { type: "string" },
                        knownLimitations: {
                            type: "array",
                            items: { type: "string" },
                        },
                        relevantTrainingCutoff: { type: "string" },
                    },
                    required: [
                        "domain",
                        "knowledgeLevel",
                        "confidenceScore",
                        "supportingEvidence",
                        "knownLimitations",
                    ],
                },
                claims: {
                    type: "array",
                    items: {
                        type: "object",
                        properties: {
                            claim: { type: "string" },
                            status: {
                                type: "string",
                                enum: [
                                    "fact",
                                    "inference",
                                    "speculation",
                                    "uncertain",
                                ],
                            },
                            confidenceScore: {
                                type: "number",
                                minimum: 0,
                                maximum: 1,
                            },
                            evidenceBasis: { type: "string" },
                            falsifiabilityCriteria: { type: "string" },
                            alternativeInterpretations: {
                                type: "array",
                                items: { type: "string" },
                            },
                        },
                        required: [
                            "claim",
                            "status",
                            "confidenceScore",
                            "evidenceBasis",
                        ],
                    },
                },
                reasoningSteps: {
                    type: "array",
                    items: {
                        type: "object",
                        properties: {
                            step: { type: "string" },
                            potentialBiases: {
                                type: "array",
                                items: { type: "string" },
                            },
                            assumptions: {
                                type: "array",
                                items: { type: "string" },
                            },
                            logicalValidity: {
                                type: "number",
                                minimum: 0,
                                maximum: 1,
                            },
                            inferenceStrength: {
                                type: "number",
                                minimum: 0,
                                maximum: 1,
                            },
                        },
                        required: [
                            "step",
                            "potentialBiases",
                            "assumptions",
                            "logicalValidity",
                            "inferenceStrength",
                        ],
                    },
                },
                overallConfidence: { type: "number", minimum: 0, maximum: 1 },
                uncertaintyAreas: { type: "array", items: { type: "string" } },
                recommendedApproach: { type: "string" },
                monitoringId: {
                    type: "string",
                    description: "Unique identifier for this monitoring session",
                },
                iteration: {
                    type: "number",
                    minimum: 0,
                    description: "Current iteration of the monitoring process",
                },
                suggestedAssessments: {
                    type: "array",
                    items: {
                        type: "string",
                        enum: ["knowledge", "claim", "reasoning", "overall"],
                    },
                },
                nextAssessmentNeeded: {
                    type: "boolean",
                    description: "Whether further assessment is needed",
                },
            },
            required: [
                "task",
                "stage",
                "overallConfidence",
                "uncertaintyAreas",
                "recommendedApproach",
                "monitoringId",
                "iteration",
                "nextAssessmentNeeded",
            ],
        },
    };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions the tool 'provides a framework for metacognitive assessment', it doesn't describe what the tool actually does with the input data - whether it analyzes, stores, returns recommendations, or generates reports. There's no information about side effects, persistence, or what constitutes a successful invocation.

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 concise with three sentences that each add value. It's front-loaded with the core purpose, followed by specific functions, and ends with the scope of application. There's no wasted text, though it could be slightly more structured with bullet points or clearer separation of concepts.

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?

For a complex tool with 12 parameters, nested objects, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, how the monitoring framework operates, or how the various parameters interact. The description mentions a 'framework' but doesn't describe its structure or outputs, leaving significant gaps for a tool of this complexity.

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

Parameters3/5

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

Schema description coverage is only 25%, but the description doesn't compensate by explaining any parameters. It mentions general concepts like 'knowledge boundaries, claim certainty, and reasoning biases' which loosely map to some parameters (knowledgeAssessment, claims, reasoningSteps), but provides no specific guidance on how to use these parameters or their relationships. The baseline is 3 since the description adds minimal value beyond the schema.

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

Purpose4/5

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

The description clearly states the tool's purpose as 'systematic self-monitoring of knowledge and reasoning quality' with specific functions like tracking knowledge boundaries, claim certainty, and reasoning biases. It distinguishes itself from sibling tools by focusing on metacognitive assessment rather than collaborative reasoning, debugging, or other specific methodologies. However, it doesn't explicitly contrast with all siblings in the list.

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?

The description mentions the tool is for 'various domains and reasoning tasks' but provides no explicit guidance on when to use this tool versus alternatives like 'collaborativereasoning' or 'debuggingapproach'. There's no mention of prerequisites, specific scenarios where metacognitive monitoring is preferred, or when other reasoning frameworks might be more appropriate.

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