Skip to main content
Glama

cancel_watch

Stop and remove a watcher by providing its watch ID to discontinue monitoring activities.

Instructions

Stop and remove a watcher

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
watch_idYesWatch ID to cancel

Implementation Reference

  • The handler logic for the 'cancel_watch' tool, which validates the input, cancels the watch from the registry, and marks it as inactive in the database.
    private async handleCancelWatch(args: Record<string, unknown>) {
      const schema = z.object({ watch_id: z.string() });
      const { watch_id } = schema.parse(args);
    
      const cancelled = this.registry.cancel(watch_id);
      if (cancelled) {
        deactivateWatch(watch_id);
      }
    
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify({ watch_id, cancelled }),
        }],
      };
  • Helper function that updates the database to mark a watch as inactive.
    export function deactivateWatch(id: string): void {
      const db = getDb();
      db.prepare(`UPDATE watches SET active = 0 WHERE id = ?`).run(id);
    }
  • src/server.ts:148-148 (registration)
    Registration of the 'cancel_watch' tool with its schema definition in the server configuration.
    name: 'cancel_watch',

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/jarvisassistantux/loopsense'

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