Skip to main content
Glama

Create automation rule

create_automation_rule
Destructive

Create an automation rule: when EVENT happens and CONDITIONS match, run ACTIONS. The conditions and actions schemas list the exact attribute keys, operators and values each event accepts. The ids and titles an action or condition needs come from list_labels, list_agents, list_teams and list_inboxes. Actions that call an external address or send attachments are not available.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "event_name": "<event_name>",
      "conditions": "<conditions>",
      "actions": "<actions>"
    },
    "name": "create_automation_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
activeNo
actionsYesWhat happens when the rule matches, in order. action_params per action: change_priority → exactly one of low, medium, high, urgent, nil; change_status → exactly one of open, resolved, pending, snoozed; assign_agent → one agent id (list_agents), or the string "nil" to unassign; assign_team → one team id (list_teams), or the string "nil" to unassign; add_label → label titles (list_labels), one or more; remove_label → label titles, one or more; send_message → the message text (one string); send_email_transcript → one string of comma-separated email addresses; mute_conversation → none; snooze_conversation → none; resolve_conversation → none; send_whatsapp_flow → one object: {flow_id (list_whatsapp_flows, published only), flow_cta (the button label, at most 30 characters), body, and optionally header, footer, initial_screen}; send_email_to_team → one object {"team_ids": [ids], "message": "text"}.
conditionsYesWhen the rule applies. Every condition after the first needs a query_operator (and / or); the first has none. attribute_key must be one the event supports: message_created: message_type, content, email, inbox_id, conversation_language, phone_number | conversation_created: status, browser_language, mail_subject, country_code, phone_number, referer, email, inbox_id, conversation_language, priority | conversation_updated: status, browser_language, mail_subject, country_code, referer, phone_number, assignee_id, team_id, email, inbox_id, conversation_language, priority | conversation_opened: browser_language, email, mail_subject, country_code, referer, assignee_id, phone_number, team_id, inbox_id, conversation_language, priority. Operators per attribute: message_type (equal_to/not_equal_to), content (equal_to/not_equal_to/contains/does_not_contain), email (equal_to/not_equal_to/contains/does_not_contain), inbox_id (equal_to/not_equal_to/is_present/is_not_present), conversation_language (equal_to/not_equal_to), phone_number (equal_to/not_equal_to/contains/does_not_contain/starts_with), status (equal_to/not_equal_to), browser_language (equal_to/not_equal_to), mail_subject (equal_to/not_equal_to/contains/does_not_contain), country_code (equal_to/not_equal_to), referer (equal_to/not_equal_to/contains/does_not_contain), priority (equal_to/not_equal_to), assignee_id (equal_to/not_equal_to/is_present/is_not_present), team_id (equal_to/not_equal_to/is_present/is_not_present). Values: status → open, resolved, pending, snoozed; priority → urgent, high, medium, low, nil (no priority); message_type → incoming, outgoing; inbox_id → inbox ids (list_inboxes); assignee_id → agent ids (list_agents); team_id → team ids (list_teams); country_code → ISO 3166-1 alpha-2, e.g. CO, US; browser_language → ISO 639-1, e.g. es, en; conversation_language → ISO 639-1, e.g. es, en; content → text fragments; contains matches any of them; phone_number → E.164, e.g. +573001234567; email → contact email; mail_subject → email subject text; referer → page URL the widget was opened from. A custom attribute (list_custom_attributes) is an attribute_key of its own with custom_attribute_type set; is_present / is_not_present take no values; attribute_changed (conversation_updated only) takes {"from": [...], "to": [...]} objects.
event_nameYes
descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare it is a write with destructiveHint=true and idempotentHint=false, so safety context is partly covered. The description adds a useful capability limit and dependency chain, but says nothing about duplicate-name behavior, required permissions, or why the operation is non-idempotent. The exclusion line is also ambiguous, since send_email_to_team and send_email_transcript appear in the action enum, so the agent cannot be sure which is meant.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Only four sentences, front-loaded with the event/condition/action model before the dependency and restriction notes. There is minor redundancy when it directs the agent to schemas that already document the accepted keys, but the pointer is short and useful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex nested rule-builder with no output schema, the definition covers the rule semantics, value sources and a capability limit. It is not fully complete, because it omits what the call returns, how failures such as invalid event/attribute pairs surface, and whether the created rule is active by default.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 33% schema coverage, the description must compensate, and it does so for the nested structures by pointing at the conditions/actions schema and the list_* tools for identifiers. However, the top-level parameters name, active and description get no mention at all. The rest of the semantic load is carried by the very long inline schema descriptions rather than this text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource and explains the rule model itself: 'Create an automation rule: when EVENT happens and CONDITIONS match, run ACTIONS.' That event/condition/action framing lets an agent distinguish this from update_automation_rule, toggle_automation_rule and the other create_* siblings without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states prerequisites clearly, telling the agent that ids and titles must be fetched from list_labels, list_agents, list_teams and list_inboxes first, and names an exclusion ('Actions that call an external address or send attachments are not available'). It never explicitly contrasts create with update_automation_rule, so the guidance is strong but not complete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources