Skip to main content
Glama
cyqlelabs

MCP Dual-Cycle Reasoner

by cyqlelabs

stop_monitoring

Terminate metacognitive monitoring sessions to retrieve a concise summary of insights and reasoning patterns detected by the MCP Dual-Cycle Reasoner.

Instructions

Stop metacognitive monitoring and get session summary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute handler function for the 'stop_monitoring' tool. It retrieves the session engine, logs the stop action, calls stopMonitoring on the engine, and returns a formatted session summary.
    execute: async (args, { log, session }) => {
      try {
        const sessionEngine = this.getSessionEngine(session);
        const sessionId = this.sessionIds.get(session);
        const status = sessionEngine.getMonitoringStatus();
    
        log.info('Stopping monitoring', {
          goal: status.current_goal,
          interventions: status.intervention_count,
          traceLength: status.trace_length,
          sessionId,
        });
    
        sessionEngine.stopMonitoring();
    
        return (
          `๐Ÿ›‘ Monitoring stopped. Session summary:\n` +
          `- Goal: ${status.current_goal}\n` +
          `- Total interventions: ${status.intervention_count}\n` +
          `- Trace length: ${status.trace_length} actions`
        );
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        log.error('Failed to stop monitoring', { error: errorMessage });
        throw new UserError(`Failed to stop monitoring: ${errorMessage}`);
      }
    },
  • src/server.ts:279-317 (registration)
    The registration of the 'stop_monitoring' tool via this.server.addTool in the addStopMonitoringTool method.
    this.server.addTool({
      name: 'stop_monitoring',
      description: 'Stop metacognitive monitoring and get session summary',
      parameters: z.object({}),
      annotations: {
        title: 'Stop Metacognitive Monitoring',
        readOnlyHint: false,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false,
      },
      execute: async (args, { log, session }) => {
        try {
          const sessionEngine = this.getSessionEngine(session);
          const sessionId = this.sessionIds.get(session);
          const status = sessionEngine.getMonitoringStatus();
    
          log.info('Stopping monitoring', {
            goal: status.current_goal,
            interventions: status.intervention_count,
            traceLength: status.trace_length,
            sessionId,
          });
    
          sessionEngine.stopMonitoring();
    
          return (
            `๐Ÿ›‘ Monitoring stopped. Session summary:\n` +
            `- Goal: ${status.current_goal}\n` +
            `- Total interventions: ${status.intervention_count}\n` +
            `- Trace length: ${status.trace_length} actions`
          );
        } catch (error) {
          const errorMessage = error instanceof Error ? error.message : String(error);
          log.error('Failed to stop monitoring', { error: errorMessage });
          throw new UserError(`Failed to stop monitoring: ${errorMessage}`);
        }
      },
    });
  • Schema definition for the stop_monitoring tool: empty parameters (no input required), with annotations specifying tool properties.
    name: 'stop_monitoring',
    description: 'Stop metacognitive monitoring and get session summary',
    parameters: z.object({}),
    annotations: {
      title: 'Stop Metacognitive Monitoring',
      readOnlyHint: false,
      destructiveHint: false,
      idempotentHint: true,
      openWorldHint: false,
    },
  • The supporting stopMonitoring method in DualCycleEngine class, called by the tool handler to set isMonitoring to false and log the stop event.
    stopMonitoring(): void {
      this.isMonitoring = false;
      console.log(chalk.blue('๐Ÿง  Dual-Cycle Engine: Monitoring stopped'));
      console.log(chalk.gray(`Total interventions: ${this.interventionCount}`));
    }
  • src/server.ts:225-225 (registration)
    The call to addStopMonitoringTool() in setupTools() method, which triggers the tool registration.
    this.addStopMonitoringTool();
Install Server

Other Tools

Related 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/cyqlelabs/mcp-dual-cycle-reasoner'

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