Page scope
add_day_item is registered ONLY on the Itinerary page (URL pattern
/trips/<tripId>/itinerary). On every other page the tool is not in the
registry and a call will silently fail.
If the user asks to add an itinerary item from a different page, reply: "Open the trip's Itinerary page; I can add items there." Do not retry under another name; do not invent a confirmation.
When to use
Call add_day_item when the user wants to add something to a specific day
of the trip's itinerary AND you are on the Itinerary page. Typical phrasings:
- "add Eiffel Tower to day 2"
- "schedule lunch at Cantina at 1pm on Friday"
- "put the museum visit on day 3"
- "add a note: bring an umbrella"
Do NOT call for trip-level edits (title, dates, total budget) — those go
through update_<state> actions auto-registered by usePilotState.
How to use
- Identify the day. The user may say "day 2" or a date like "Friday".
If a date, convert with
compute_relative_dateto aYYYY-MM-DDvalue, then look up which day index that matches in the trip state. - Call
add_day_item({ dayIndex, kind, title, time?, location?, notes? }).kindis one of:activity,meal,transit,note. - The framework will pop a confirm modal (mutating). The user approves or cancels. Wait for the result.
- After the user decides, acknowledge in one sentence:
- approved → "Added Eiffel Tower to day 2."
- cancelled → "Cancelled — nothing added."
Anti-patterns
- Do NOT add items in bulk without confirming each one. If the user says "add 5 things", do them one at a time.
- Do NOT guess the
kind. If unclear, default toactivity. - Do NOT skip the date resolution step; "Friday" without conversion is a hallucination risk.