create_or_update_python_task
Schedule and run Python scripts as macOS LaunchAgent jobs by creating or updating a launchd service with configurable triggers, environment, and process settings.
Instructions
Create/update a LaunchAgent from a Python script string and load it.
Args: task_name: Human friendly task name. Will be sanitized for label suffix. python_script: Python source code to execute. label_prefix: Reverse-domain prefix (e.g. "link.igtm.launchd-mcp"). run_at_load: Whether to run immediately after load. start_interval_seconds: Optional StartInterval in seconds. start_calendar: Optional object/array for StartCalendarInterval. watch_paths_csv: Optional comma-separated list for WatchPaths. queue_directories_csv: Optional comma-separated list for QueueDirectories. working_directory: Optional WorkingDirectory. Defaults to task directory. python_bin: Optional python executable path. Defaults to python3 on PATH. extra_path_csv: Optional comma-separated PATH entries prepended in plist. keep_alive: Optional KeepAlive (bool or object). throttle_interval_seconds: Optional ThrottleInterval in seconds. process_type: Optional ProcessType (Background/Standard/Adaptive/Interactive). nice: Optional Nice value. umask: Optional octal umask like "022" or "0o022". hard_resource_limits: Optional HardResourceLimits object. replace_existing: If true, bootout existing service first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nice | No | ||
| umask | No | ||
| task_name | Yes | ||
| keep_alive | No | ||
| python_bin | No | ||
| run_at_load | No | ||
| label_prefix | No | link.igtm.launchd-mcp | |
| process_type | No | ||
| python_script | Yes | ||
| extra_path_csv | No | ||
| start_calendar | No | ||
| watch_paths_csv | No | ||
| replace_existing | No | ||
| working_directory | No | ||
| hard_resource_limits | No | ||
| queue_directories_csv | No | ||
| start_interval_seconds | No | ||
| throttle_interval_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |