Skip to main content
Glama
cyqlelabs

MCP Dual-Cycle Reasoner

by cyqlelabs

stop_monitoring

Idempotent

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();
Behavior4/5

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

Annotations cover key traits: readOnlyHint=false (implies mutation), destructiveHint=false (non-destructive), idempotentHint=true (safe to retry). The description adds value by specifying that stopping monitoring yields a 'session summary', which isn't captured in annotations. It doesn't disclose rate limits or auth needs, but with annotations providing safety profile, this is acceptable. No contradiction with annotations.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core action ('stop metacognitive monitoring') and adds the outcome ('get session summary'). Every word contributes meaning without redundancy, making it highly concise and well-structured for quick understanding.

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

Completeness4/5

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

Given the tool has 0 parameters, annotations cover safety (non-destructive, idempotent), and no output schema, the description is reasonably complete. It explains the action and result, though it could benefit from clarifying the format of the 'session summary' or any side effects. For a simple stop operation, it provides adequate context without overcomplicating.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't mention parameters, which is appropriate. Baseline is 4 for zero parameters, as it avoids unnecessary details and focuses on the tool's action.

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 with specific verbs ('stop monitoring' and 'get session summary') and identifies the resource ('metacognitive monitoring'). It distinguishes from siblings like 'start_monitoring' and 'get_monitoring_status' by indicating termination rather than initiation or status checking. However, it doesn't explicitly contrast with all siblings, such as 'reset_engine' or 'configure_detection', which might have overlapping contexts.

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

Usage Guidelines3/5

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

The description implies usage when stopping monitoring is needed, suggesting context after monitoring has started (e.g., using 'start_monitoring'). It doesn't provide explicit when-not-to-use guidance or name alternatives like 'reset_engine' for similar cleanup actions. The guidance is basic and relies on inference from the tool name and sibling context.

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

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