Skip to main content
Glama

Create Rule

create_rule

Create a new automation rule. Accepts the full rule definition: scope (company/user), name, trigger, conditions, actions, executionMode (propose/autopilot/observe), priority, and optional cooldownSeconds. Use get_rule_catalog first to understand valid trigger/condition/action combinations, and check_rule_conflicts to detect overlaps. The preview shows the rule in plain English and refuses unacknowledged conflicts; the commit returns the saved rule with its id and version. Requires Write + automation.execute; company rules need the Admin role and an operator (unpinned) credential.

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": {
      "rule": "<rule>"
    },
    "name": "create_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
ruleYesThe rule definition — JSON object: scope, name, description, enabled, trigger, conditions, actions, executionMode, priority, cooldownSeconds, conflictsAcknowledged.
previewNoStep 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing changes until the commit call.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused.

Output Schema

NameRequiredDescriptionDefault
okNo
ruleNo
effectsNo
previewNo
warningsNo
expiresAtNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
previousVersionNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations, which only supply false/true hints: it discloses the mandatory two-step flow, that the preview renders the rule in plain English and refuses unacknowledged conflicts, that commit returns the saved rule with id and version, and the exact permission/role/credential requirements (Write + automation.execute, Admin for company scope, operator/unpinned credential). This is precisely the kind of context an agent needs before performing a write it cannot trivially undo.

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?

Purpose is front-loaded, alternatives follow, and constraints close — a sensible information hierarchy with no filler sentences. The final permission clause is somewhat run-on and packed with several distinct requirements in one breath, which costs it a point.

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?

For a nested-object create tool with an output schema, an idempotency flow, and role-gated scopes, the description covers what to do first, what the two steps do, what comes back, and who is allowed to call it. Return-value details are correctly left to the output schema rather than duplicated.

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

Parameters4/5

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

Schema coverage is 100% and the nested conditions grammar is documented inline, so the baseline is 3. The description still adds meaning by framing preview/previewReceipt/idempotencyKey as a receipt-driven two-step protocol and by explaining what each step yields (plain-English preview vs. saved rule with id and version), which is more than the field descriptions alone convey.

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

Purpose4/5

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

Opens with a specific verb+resource ("Create a new automation rule") and immediately enumerates the accepted definition fields (scope, name, trigger, conditions, actions, executionMode, priority, cooldownSeconds), so the agent knows exactly what it is building. It does not, however, contrast itself with the closely-named siblings draft_rule or update_rule, leaving that distinction to inference.

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?

Gives explicit preconditions and sequencing: call get_rule_catalog first to learn valid trigger/condition/action combinations, then check_rule_conflicts for overlaps, then the preview/commit two-step. It stops short of stating when to use this over draft_rule (author-then-persist vs. one-shot create), so the alternative-routing is incomplete but the positive guidance is strong.

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