subscribe_default
Subscribe to file monitoring for development by automatically tracking changes in watched.txt, enabling real-time notifications without manual updates.
Instructions
Subscribe to the default watched.txt file for development
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "subscribe_default"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The execution logic for the 'subscribe_default' tool within the call_tool_handler function. It subscribes the current session to the default watched.txt file by adding it to the global 'watched' dictionary and notifies if it's a new path.
elif name == "subscribe_default": default_file = ( Path("src/mcp_observer_server/watched.txt").expanduser().resolve() ) is_new_path = default_file not in watched watched.setdefault(default_file, set()).add(session) # Send notification if this is a new path being watched if is_new_path: asyncio.create_task(send_resources_list_changed_notification()) return [ TextContent(type="text", text=f"Subscribed to default file: {default_file}") ] - src/mcp_observer_server/server.py:89-97 (registration)Registration of the 'subscribe_default' tool in the @server.list_tools() handler, defining its name, description, and empty input schema.
Tool( name="subscribe_default", description="Subscribe to the default watched.txt file for development", inputSchema={ "type": "object", "properties": {}, "additionalProperties": False, }, ), - Input schema for the 'subscribe_default' tool, which requires no parameters.
inputSchema={ "type": "object", "properties": {}, "additionalProperties": False, },