Domain: email

System prompt:
You are a helpful Email assistant with access to all available tools. Operate in a safe and fully authorized environment—you do not need to ask for confirmation or permission before taking action. When identifiers such as names or IDs are missing, perform exactly one lookup per entity type, verify that you are reusing correct values from previous responses, and proceed using the retrieved data. Never assume or fabricate IDs, responses, or outcomes—rely solely on verified API results. Complete each task in a single, logical, and efficient execution flow.

Task:
I want to build a proper review pipeline inside my mailbox.
Start by gathering every message that references a meeting, milestone, review, or proposal.
Label those messages as “Needs Review”.

Now look at the threads these messages belong to.
If the thread has more than one message in it, label all messages in that thread as “Active Thread”.

After that, check each of the originally matched messages for attachments.
If it contains any attachment, add the label “Detailed Document”.
If it doesn’t have any attachments, add “Quick Review”.

Finally, if the message is already labeled under “Projects” or “Important”, go ahead and add “Priority Task” as well.

Please create any labels as needed and avoid changing anything in draft messages.

Available tools:
list_labels
list_messages
modify_message
modify_thread
get_thread
create_label

Verification checks:
[{"verifier_type": "database_state", "name": "needs_review_applied", "description": "Checks that messages containing relevant keywords received the \u201cNeeds Review\u201d label.", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(*)\nFROM message_labels ml\nJOIN labels l ON ml.label_id = l.id\nJOIN messages m ON ml.message_id = m.id\nWHERE l.name = 'Needs Review'\n  AND m.id IN ('msg_001', 'msg_002', 'msg_003');", "expected_value": 3, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "active_thread_correctness", "description": "Ensures only messages in the multi-message thread (thread_001) received the label.", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(*)\nFROM message_labels ml\nJOIN labels l ON ml.label_id = l.id\nWHERE l.name = 'Active Thread'\n  AND ml.message_id IN ('msg_001', 'msg_003');", "expected_value": 2, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "detailed_document_applied", "description": "Confirms only msg_002 (PDF attached) has the \u201cDetailed Document\u201d label.", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(*)\nFROM message_labels ml\nJOIN labels l ON ml.label_id = l.id\nWHERE l.name = 'Detailed Document'\n  AND ml.message_id = 'msg_002';\n", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "quick_review_applied", "description": "Ensures msg_001 and msg_003 received \u201cQuick Review\u201d.", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(*)\nFROM message_labels ml\nJOIN labels l ON ml.label_id = l.id\nWHERE l.name = 'Quick Review'\n  AND ml.message_id IN ('msg_001','msg_003');\n", "expected_value": 2, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "priority_task_applied", "description": "msg_001 has Projects \u2192 should get Priority Task msg_002 has Important \u2192 should get Priority Task", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(*)\nFROM message_labels ml\nJOIN labels l ON ml.label_id = l.id\nWHERE l.name = 'Priority Task'\n  AND ml.message_id IN ('msg_001','msg_002');\n", "expected_value": 2, "comparison_type": "equals"}}]