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:
Hi, I want to create a new label. Could you please help me with that. Create a new label named "Management", if it does not exist. Apply this label to all the messages where either a receiver or a sender is manager@company.com., but do not label any drafts. Remove any other labels applied to these messages.

Available tools:
batch_modify_messages
create_label
list_messages
list_labels

Verification checks:
[{"verifier_type": "database_state", "name": "Check if a new label is created", "description": "Check if a new label is created", "gym_name": "gym-email-mcp", "validation_config": {"query": "select count(*) from labels where user_id = 'user_001' and name = 'Management'", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Check that old messages do not have any other labels", "description": "Check that old messages do not have any other labels", "gym_name": "gym-email-mcp", "validation_config": {"query": "select distinct l.name from labels l join message_labels ml on l.id = ml.label_id where ml.message_id in ('msg_001', 'msg_003')", "expected_value": "Management", "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Check if old messages has the new label Management", "description": "Check if old messages has the new label Management", "gym_name": "gym-email-mcp", "validation_config": {"query": "select count(*) from message_labels ml join labels l on l.id = ml.label_id where l.user_id = 'user_001' and l.name = 'Management'", "expected_value": 2, "comparison_type": "equals"}}]