unsubscribe
Stop receiving real-time notifications for changes on a specific file or directory by removing the subscription via the MCP Observer Server.
Instructions
Unsubscribe from changes on a file or directory
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
Implementation Reference
- Handler logic for the 'unsubscribe' tool: removes the current session from the subscribers of the specified path, deletes the path entry if no subscribers remain, and returns appropriate text response.elif name == "unsubscribe": assert path_str is not None, "path_str should not be None for unsubscribe tool" p = Path(path_str).expanduser().resolve() subs = watched.get(p) if subs and session in subs: subs.remove(session) if not subs: del watched[p] return [TextContent(type="text", text=f"Unsubscribed from {p}")] return [TextContent(type="text", text=f"Not subscribed to {p}")]
- src/mcp_observer_server/server.py:71-79 (registration)Registration of the 'unsubscribe' tool in the list_tools() function, including name, description, and input schema.Tool( name="unsubscribe", description="Unsubscribe from changes on a file or directory", inputSchema={ "type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"], }, ),
- Input schema definition for the 'unsubscribe' tool: requires a 'path' string.inputSchema={ "type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"], },