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 am trying to clean up my tags. I think I have two labels for the same thing: 'Marketing 2024' and 'Mktg 24'.
Please list my labels to check. If you find 'Mktg 24', please delete it immediately. I only want to keep 'Marketing 2024', if not found create it.
Next, list my filters. Check if I already have a rule for 'newsletter@marketing.com'.
If that filter is missing, please create a new filter that tags emails from 'newsletter@marketing.com' with the 'Marketing 2024' label.

Available tools:
list_filters
create_label
create_filter
delete_label
list_labels

Verification checks:
[{"verifier_type": "database_state", "name": "Verify Redundant Label Deleted", "description": "Verify Redundant Label Deleted Successfully", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT \n     (SELECT COUNT(id) FROM labels \n          WHERE user_id = 'user_001' AND name = 'Marketing 2024')\n    -\n    (SELECT COUNT(id) FROM labels \n     WHERE user_id = 'user_001' AND name = 'Mktg 24');", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Verify Filter Creation", "description": "Verify Filter Created Successfully", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(F.id)\nFROM filters AS F\nJOIN labels AS L ON F.user_id = L.user_id\nWHERE F.user_id = 'user_001'\n  AND L.name = 'Marketing 2024'\n  AND json_extract(F.criteria_json, '$.from') = 'newsletter@marketing.com'\n  AND json_extract(F.action_json, '$.addLabelIds') LIKE '%' || L.id || '%';", "expected_value": 1, "comparison_type": "equals"}}]