track
Start and end each user message processing to measure task duration and notify users by iPhone when long AI tasks finish.
Instructions
REQUIRED: Call this at the START and END of processing EVERY user message to track task duration and notify the user when long tasks complete.
IMPORTANT CLARIFICATION:
This tracks EACH user message processing, NOT the entire multi-turn conversation
Every time the user sends a message, you must call track(action="start") at the beginning and track(action="end") at the end
WHEN TO CALL:
action="start": IMMEDIATELY when the user sends a message, BEFORE you start processing it
action="end": RIGHT AFTER you finish your response to that message
WHY THIS MATTERS: Without tracking each message processing, the user won't receive iPhone notifications when AI tasks complete. They may:
Waste time staring at the screen waiting
Forget to check back and abandon tasks
Not know if the task succeeded or failed
WORKFLOW FOR EACH USER MESSAGE:
User sends a message
Call track({action: "start", task_id: "msg-YYYYMMDD-NNN", task_name: "brief description"})
Process the request and generate your response
Call track({action: "end", task_id: "msg-YYYYMMDD-NNN"})
Send your response to the user
NOTIFICATION LOGIC:
If message processing >60 seconds AND user left IDE → Sends iPhone notification
Otherwise → Silent completion (no notification needed)
EXAMPLE: User: "Refactor the auth module" → track({action: "start", task_id: "msg-2024-01-28-001", task_name: "Refactoring authentication module"}) → Process and generate response → track({action: "end", task_id: "msg-2024-01-28-001"}) → Send response to user
⚠️ NEVER skip this tool. Call it for EVERY user message you process. User relies on notifications for long-running tasks.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>",
"task_id": "<task_id>"
},
"name": "track"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Use "start" at conversation begin, "end" at conversation finish | |
| task_id | Yes | Unique conversation ID (use format: chat-YYYYMMDD-NNN) | |
| task_name | No | Brief description of what this conversation is about (required when action=start) |