watch_directory
Monitors a directory for file system events like creation, modification, deletion, and moves, returning a watch ID for polling or unwatching.
Instructions
Start watching a directory for file system events.
Returns a watch_id that can be used with poll_events and unwatch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the directory to watch. | |
| recursive | No | If True, also watch all subdirectories recursively. | |
| extensions | No | Optional list of file extensions to include, e.g. [".py", ".js"]. If omitted, all extensions are reported. | |
| pattern | No | Optional glob pattern matched against the file *name*, e.g. "*.log". Applied in addition to (not instead of) the extensions filter. | |
| ignore_patterns | No | Optional glob patterns to exclude, e.g. ["*.tmp", ".git/*"]. Matched against both the file name and its full path. | |
| event_types | No | Optional subset of event types to report. Valid values: "created", "modified", "deleted", "moved". If omitted, all event types are reported. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||