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’m trying to clean up my mailbox a bit because a lot of different work threads have been piling up. 
Some conversations talk about the quarterly review, others include project milestone updates, and a few 
contain proposals, budgets, or timeline adjustments. I don’t remember exactly where everything is, so 
please scan through my messages and organize things for me.

Create a new label called “Work Coordination” and another called “Needs Follow-Up”. 
Anything that mentions reviews, milestones, proposals, budget items, or changes to plans or timelines 
should be labeled “Work Coordination”. If a message is part of a thread with more than one message, or 
if it seems like it was written in response to an earlier update, also tag it with “Needs Follow-Up”.

Please also check each thread so the right messages get the right labels depending on where they appear, 
but leave all drafts as they are. I just want the active conversations organized clearly across the 
threads that they belong to.

Available tools:
list_labels
modify_message
list_messages
get_thread
create_label

Verification checks:
[{"verifier_type": "database_state", "name": "Work Coordination & Follow-Up Labels Exist", "description": "Checks that both labels created by the agent (\u201cWork Coordination\u201d and \u201cNeeds Follow-Up\u201d) exist for user_001.", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(*) \nFROM labels\nWHERE user_id = 'user_001'\nAND name IN ('Work Coordination', 'Needs Follow-Up');\n", "expected_value": 2, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Work Coordination Applied to All Matching Messages", "description": "Ensures messages that contain review, milestone, proposal, budget, plan/timeline keywords are tagged with \u201cWork Coordination\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 = 'Work Coordination'\nAND ml.message_id IN ('msg_001', 'msg_002', 'msg_003');\n", "expected_value": 3, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Follow-Up Label Applied to Thread Replies", "description": "Verifies that \u201cNeeds Follow-Up\u201d is applied to the messages in multi-message threads.", "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 Follow-Up'\nAND m.thread_id = 'thread_001'\nAND m.id IN ('msg_001', 'msg_003');\n", "expected_value": 2, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "No Follow-Up Label on Single-Message Threads", "description": "Ensures \u201cNeeds Follow-Up\u201d was NOT incorrectly applied to thread_002 (single message: msg_002).", "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 = 'Needs Follow-Up'\nAND ml.message_id = 'msg_002';\n", "expected_value": 0, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Draft Messages Not Relabeled", "description": "Ensures NO new label (other than system DRAFT) was applied to any draft message.", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(*)\nFROM message_labels ml\nWHERE ml.message_id LIKE 'draft_msg_%'\nAND ml.label_id NOT IN (\n    SELECT id FROM labels WHERE name = 'DRAFT'\n);\n", "expected_value": 0, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "No Unrelated Messages Labeled Incorrectly", "description": "Ensures only these 3 messages were labeled \u201cWork Coordination\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 = 'Work Coordination'\nAND ml.message_id NOT IN ('msg_001','msg_002','msg_003');\n", "expected_value": 0, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "No Incorrect Follow-Up Assignment", "description": "Ensures that only thread_001 messages contain \u201cNeeds Follow-Up\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 = 'Needs Follow-Up'\nAND ml.message_id NOT IN ('msg_001','msg_003');\n", "expected_value": 0, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Work Coordination & Follow-Up Labels Exist", "description": "Checks that both labels created by the agent (\u201cWork Coordination\u201d and \u201cNeeds Follow-Up\u201d) exist for user_001.", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(*) \nFROM labels\nWHERE user_id = 'user_001'\nAND name IN ('Work Coordination', 'Needs Follow-Up');\n", "expected_value": 2, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Work Coordination Applied to All Matching Messages", "description": "Ensures messages that contain review, milestone, proposal, budget, plan/timeline keywords are tagged with \u201cWork Coordination\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 = 'Work Coordination'\nAND ml.message_id IN ('msg_001', 'msg_002', 'msg_003');\n", "expected_value": 3, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Follow-Up Label Applied to Thread Replies", "description": "Verifies that \u201cNeeds Follow-Up\u201d is applied to the messages in multi-message threads.", "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 Follow-Up'\nAND m.thread_id = 'thread_001'\nAND m.id IN ('msg_001', 'msg_003');\n", "expected_value": 2, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "No Follow-Up Label on Single-Message Threads", "description": "Ensures \u201cNeeds Follow-Up\u201d was NOT incorrectly applied to thread_002 (single message: msg_002).", "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 = 'Needs Follow-Up'\nAND ml.message_id = 'msg_002';\n", "expected_value": 0, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Draft Messages Not Relabeled", "description": "Ensures NO new label (other than system DRAFT) was applied to any draft message.", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(*)\nFROM message_labels ml\nWHERE ml.message_id LIKE 'draft_msg_%'\nAND ml.label_id NOT IN (\n    SELECT id FROM labels WHERE name = 'DRAFT'\n);\n", "expected_value": 0, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "No Unrelated Messages Labeled Incorrectly", "description": "Ensures only these 3 messages were labeled \u201cWork Coordination\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 = 'Work Coordination'\nAND ml.message_id NOT IN ('msg_001','msg_002','msg_003');\n", "expected_value": 0, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "No Incorrect Follow-Up Assignment", "description": "Ensures that only thread_001 messages contain \u201cNeeds Follow-Up\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 = 'Needs Follow-Up'\nAND ml.message_id NOT IN ('msg_001','msg_003');\n", "expected_value": 0, "comparison_type": "equals"}}]