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
| Name | Required | Description | Default |
|---|---|---|---|
| watch_id | Yes | Watch ID to cancel |
Implementation Reference
- src/server.ts:455-469 (handler)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 }), }], }; - src/store/db.ts:126-129 (helper)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',