remove_watch
Remove a watch expression from Xdebug debugging sessions to stop monitoring specific variables or conditions during PHP application debugging.
Instructions
Remove a watch expression
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| watch_id | Yes | Watch ID to remove |
Implementation Reference
- src/tools/advanced.ts:61-78 (handler)Full MCP tool registration, schema, and handler for 'remove_watch'. The handler removes the watch using ctx.watchManager.removeWatch(watch_id) and returns a JSON response indicating success.server.tool( 'remove_watch', 'Remove a watch expression', { watch_id: z.string().describe('Watch ID to remove'), }, async ({ watch_id }) => { const success = ctx.watchManager.removeWatch(watch_id); return { content: [ { type: 'text', text: JSON.stringify({ success, watch_id }), }, ], }; } );
- src/session/watch-manager.ts:54-60 (helper)The WatchManager.removeWatch(id) method that implements the core logic of removing a watch expression by deleting it from the internal watches Map.removeWatch(id: string): boolean { const removed = this.watches.delete(id); if (removed) { logger.debug(`Watch removed: ${id}`); } return removed; }