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:
Hello, I want you to create a new filter for me. First of all, check if I already have a filter 'to manager@company.com'. If I don't create a new filter, so that all messages to manager@company.com have a label: "Important". As far as I remember, I already have this filter, but please check again. Finally, send the message to manager@company.com and check if the label is applied or not by this new filter. If the filter is not applied, let me know, I will check the filter by myself. The subject should be "Just Ignore this message", and the text should be "Hello, I am just checking something. Please ignore this message."

Available tools:
send_message
create_filter
list_filters
list_labels
get_message

Verification checks:
[{"verifier_type": "database_state", "name": "Check that the message is sent to manager@company.com", "description": "Check that the message is sent to manager@company.com", "gym_name": "gym-email-mcp", "validation_config": {"query": "select count(*) from messages m join message_parts mp on mp.message_id = m.id join message_headers mh on mh.message_part_id = mp.id where m.user_id = 'user_001' and m.snippet = 'Just Ignore this message' and mh.name = 'To' and mh.value = 'manager@company.com'", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Check that the filter has a correct rule", "description": "Check that the filter has a correct rule", "gym_name": "gym-email-mcp", "validation_config": {"query": "SELECT COUNT(*) AS cnt\nFROM filters f\nWHERE json_extract(f.criteria_json, '$.to') = 'manager@company.com'\n  AND EXISTS (\n        SELECT 1\n        FROM json_each(f.action_json, '$.addLabelIds') AS j\n        JOIN labels l ON l.id = j.value\n        WHERE l.name = 'Important'\n  )", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Check that the message is sent with correct content", "description": "Check that the message is sent with correct content", "gym_name": "gym-email-mcp", "validation_config": {"query": "select count(*) from messages m join message_parts mp on mp.message_id = m.id join message_headers mh on mh.message_part_id = mp.id where m.user_id = 'user_001' and mh.name = 'Subject' and mh.value = 'Just Ignore this message'", "expected_value": 1, "comparison_type": "equals"}}]