Skip to main content
Glama

list_watches

Display all active watch expressions to monitor PHP variable values during debugging sessions.

Instructions

List all active watch expressions

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "properties": {}, "type": "object" }

Implementation Reference

  • The complete registration block for the 'list_watches' tool, including the inline empty input schema, description, and the handler function that executes the tool logic by retrieving all watches from WatchManager and formatting them as JSON response.
    server.tool( 'list_watches', 'List all active watch expressions', {}, async () => { const watches = ctx.watchManager.getAllWatches(); return { content: [ { type: 'text', text: JSON.stringify( { watches: watches.map((w) => ({ id: w.id, expression: w.expression, lastValue: w.lastValue, hasChanged: w.hasChanged, evaluationCount: w.evaluationCount, })), }, null, 2 ), }, ], }; } );
  • Core helper method getAllWatches() in WatchManager class that returns the array of all active watch expressions stored in the internal Map.
    getAllWatches(): WatchExpression[] { return Array.from(this.watches.values()); }

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