Add day-of-week validation for task dates#15
Open
partymola wants to merge 1 commit into
Open
Conversation
When dueDate is set on create_task or update_task, the caller must also pass expectedDayOfWeek (e.g. 'Monday'). The MCP validates the date falls on that day - in the task's timeZone when provided - and returns an error on mismatch. This catches agents that say 'Monday' but pass a Tuesday date. - Hardcoded English day names (locale-independent) - Non-English names rejected with clear error listing valid values - Timezone-aware: resolves day in task timeZone, not just UTC offset - Field excluded from TickTick API payloads (validation-only) - 16 tests covering match/mismatch, timezone, i18n, serialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
dueDateis set oncreate_taskorupdate_task, the caller must also passexpectedDayOfWeek(e.g."Monday"). The server validates the date actually falls on that day and returns an error on mismatch.Why
LLM agents sometimes say "Monday" but pass a date that is actually a Tuesday. This cross-check catches the inconsistency before the task is created.
Details
timeZonewhen provided, so late-night UTC dates resolve to the correct local day"2026-04-14 is Tuesday in Europe/London, not Monday"expectedDayOfWeekis excluded from TickTick API payloads (validation-only, never sent upstream)ticktick_create_task(function parameter) andticktick_update_task(TaskObjectfield withexclude=True)Test plan