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
| Name | Required | Description | Default |
|---|---|---|---|
| watch_id | Yes | Watch ID to remove |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"watch_id": {
"description": "Watch ID to remove",
"type": "string"
}
},
"required": [
"watch_id"
],
"type": "object"
}
Implementation Reference
- src/tools/advanced.ts:67-77 (handler)MCP tool handler function for 'remove_watch'. It receives the watch_id parameter, calls ctx.watchManager.removeWatch(watch_id), and returns a JSON response indicating success.async ({ watch_id }) => { const success = ctx.watchManager.removeWatch(watch_id); return { content: [ { type: 'text', text: JSON.stringify({ success, watch_id }), }, ], }; }
- src/tools/advanced.ts:64-66 (schema)Zod input schema defining the 'watch_id' parameter as a required string for the remove_watch tool.{ watch_id: z.string().describe('Watch ID to remove'), },
- src/tools/advanced.ts:62-78 (registration)Registration of the 'remove_watch' MCP tool on the server, including name, description, schema, and handler.'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)WatchManager.removeWatch method that deletes the watch from the internal Map and logs the action. Called by the tool handler.removeWatch(id: string): boolean { const removed = this.watches.delete(id); if (removed) { logger.debug(`Watch removed: ${id}`); } return removed; }