Skip to main content
Glama

Define automation rule

define_automation
Destructive

Create an automation rule: when trigger_event fires (record.written) and condition_spec matches, run action_tool with action_args (a {{placeholder}} template over the trigger facts). The action re-enters the governance chokepoint, so it still respects approvals + write-scope. Requires the workspace automation flag to actually fire. Returns the rule. An existing rule is edited with update_record / delete_record on object_type "automation" (its id and key come from describe_schema).

When to use: When an admin wants an action to fire automatically on a record write — e.g. flag big deals, create a follow-up task.

Example: When an opportunity over $100k is created, make a task for me to review it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelYesDisplay name for the rule. Its slug becomes the rule key, which must be unique in the workspace.
action_argsNoArguments for action_tool. String values may embed {{object_key}}, {{tool_name}}, {{record_id}} or {{account_id}}; a whole-string placeholder keeps the fact's raw type.
action_toolYesThe registered tool to run, by name (e.g. create_record, add_note). Account-creating actions (create_account, migrate_crm, create_record of account) are refused.
trigger_eventNoThe event that fires the rule. Only "record.written" (any governed record write) exists today; it is the default.
condition_specNoall (AND) / any (OR) lists of {field, op, value?} on object_key, tool_name, record_id, account_id; op eq/neq/gt/gte/lt/lte/contains/in/is_null/is_not_null. {} = every write.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
automationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations (destructiveHint=true, openWorldHint=true, idempotentHint=false) cover the safety profile, and the description adds non-obvious behavior beyond them: the action re-enters the governance chokepoint and still respects approvals/write-scope, plus the workspace automation flag prerequisite. It stops short of describing failure modes (e.g. duplicate rule key, refused account-creating actions at runtime), so it is strong but not exhaustive.

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?

Front-loaded with the dense core mechanics before the when-to-use and example. Efficient overall, though the 'When to use' plus example section restates the same use case twice, adding minor redundancy.

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

Completeness5/5

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

An output schema exists so return values ('Returns the rule') need no elaboration. The description covers purpose, eligibility, dependencies, and the edit path, leaving nothing an agent needs to invoke it correctly missing.

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?

Schema description coverage is 100%, so all five parameters are already documented in the schema, including placeholder syntax, condition operators, and the action_tool restrictions. The description largely summarizes that same content (governance re-entry, placeholder template), adding little parameter meaning beyond the schema baseline.

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?

States a specific verb+resource ('Create an automation rule') and immediately elaborates the trigger→condition→action model, which distinguishes it from sibling define_* tools like define_object, define_field, and define_pipeline. An agent can tell what this tool registers without opening the schema.

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

Usage Guidelines5/5

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

Explicit 'When to use' clause with concrete examples (flag big deals, create a follow-up task) and a worked example. It also routes editing to the correct alternatives (update_record / delete_record on object_type 'automation'), naming where the id/key come from.

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