gantt_optimize
Ask the AI to propose a new schedule for a project that fits all tasks before a target deadline while respecting dependencies. Returns an array of {taskId, startDate, dueDate} proposals (YYYY-MM-DD strings), any warnings, and feasibility status. Use mode="preview" (default) to inspect the proposal first; use mode="apply" to capture a baseline and commit the dates immediately (requires project Owner or Manager role). Cap: 100 tasks per project. Use when the user asks "can we finish by [date]?" or "reschedule this project to meet the deadline".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | preview (default): return proposals without writing. apply: capture a baseline then commit all proposed dates. Requires project Owner or Manager role. | preview |
| deadline | Yes | Target end date in YYYY-MM-DD format. All tasks will be proposed to finish on or before this date. | |
| previewId | No | The previewId a preview of this project returned. When a preview returns one, apply mode writes exactly that stored preview instead of proposing again, and refuses without it or when the plan changed since. | |
| projectId | Yes | ID of the project to optimize the schedule for. | |
| levelResources | No | When true (default: false), the AI avoids overallocating any user beyond their ResourceCapacity.hoursAvail for the week. | |
| allowOverallocation | No | When true, overallocation warnings are surfaced but not treated as failures. Default false (overallocation causes a retry). |