Skip to main content
Glama

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

NameRequiredDescriptionDefault
watch_idYesWatch 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

  • 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 }), }, ], }; }
  • 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'), },
  • 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 }), }, ], }; } );
  • 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; }

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/kpanuragh/xdebug-mcp'

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