> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superlaunch.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# Rule tools

> Create rules, edit their conditions, and inspect runs.

Read `rules_schema` for the current rule vocabulary. Read the current rule version before an update. `rules_update` replaces the definition. `rules_run` defaults to dry-run mode.

The tables list arguments and common nested fields. Expand **Full input schema** for all fields and allowed values. Workspace and account permissions apply to every tool.

<span id="rules-schema" />

## rules\_schema

List the metrics, conditions, actions, and fields supported by the rule builder.

**Access:** `mcp:read`.

**Arguments:** none.

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {},
    "type": "object"
  }
  ```
</Accordion>

<span id="rules-list" />

## rules\_list

List rules for which you can read all target accounts.

**Access:** `mcp:read`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `limit` | integer | `25` | |

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "limit": {
        "default": 25,
        "type": "integer"
      }
    },
    "type": "object"
  }
  ```
</Accordion>

<span id="rules-get" />

## rules\_get

Read a rule and its current version before editing it.

**Access:** `mcp:read`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `rule_id` | uuid | Required | Rule UUID from `rules_list`. |

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "rule_id": {
        "format": "uuid",
        "type": "string"
      }
    },
    "required": [
      "rule_id"
    ],
    "type": "object"
  }
  ```
</Accordion>

<span id="rules-create" />

## rules\_create

Create a rule for accounts where you have the required permissions.

**Access:** `mcp:read` and `mcp:write`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `payload` | object | Required | Complete rule definition. |

### payload fields

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `request_id` | uuid | Required | UUID for this operation; use a new UUID for changed inputs. |
| `name` | string | Required | minLength: `1`. maxLength: `300`. |
| `provider` | string | `"meta"` | minLength: `1`. maxLength: `64`. |
| `status` | draft, active, paused | `"draft"` | |
| `ad_account_ids` | array of uuid | Required | minItems: `1`. maxItems: `20`. |
| `level` | campaign, adset, ad | `"ad"` | Advertising hierarchy levels that rules may target. |
| `target_filter` | object | Required | Nested target predicates. |
| `tasks` | array of object | Required | minItems: `1`. maxItems: `20`. |
| `schedule` | object | Required | Validated cron schedule and IANA timezone. |
| `execution_limit` | object or null | `null` | |
| `dry_run` | boolean | `true` | `true` checks the request without making live changes in Meta. |
| `metadata` | object | Optional | |

**Retries:** after a timeout, read the current state before submitting again to avoid duplicate changes.

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "$defs": {
      "ConditionNode": {
        "additionalProperties": false,
        "description": "Condition or group node with explicit discriminating kind.",
        "properties": {
          "kind": {
            "enum": [
              "condition",
              "group"
            ],
            "type": "string"
          },
          "metric": {
            "anyOf": [
              {
                "$ref": "#/$defs/MetricReferenceInput"
              },
              {
                "$ref": "#/$defs/RuleMetricId"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "timeframe": {
            "anyOf": [
              {
                "$ref": "#/$defs/MetricTimeframeInput"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "operator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "value": {
            "default": null,
            "title": "Value"
          },
          "combinator": {
            "anyOf": [
              {
                "enum": [
                  "and",
                  "or"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "children": {
            "items": {
              "$ref": "#/$defs/ConditionNode"
            },
            "maxItems": 50,
            "type": "array"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "DecreaseBudgetActionParameters": {
        "additionalProperties": false,
        "description": "Decrease parameters with an explicit account-currency floor.",
        "properties": {
          "mode": {
            "enum": [
              "percent",
              "absolute"
            ],
            "type": "string"
          },
          "value": {
            "description": "Percent when mode is percent; major account-currency units when absolute.",
            "exclusiveMinimum": 0,
            "type": "number"
          },
          "min_daily_budget": {
            "description": "Minimum allowed budget in major account-currency units (for USD, 100 means $100).",
            "exclusiveMinimum": 0,
            "type": "number"
          }
        },
        "required": [
          "mode",
          "value",
          "min_daily_budget"
        ],
        "type": "object"
      },
      "DecreaseBudgetRuleAction": {
        "additionalProperties": false,
        "description": "Budget decrease that cannot fall below its mandatory floor.",
        "properties": {
          "type": {
            "const": "decrease_budget",
            "type": "string"
          },
          "params": {
            "$ref": "#/$defs/DecreaseBudgetActionParameters"
          }
        },
        "required": [
          "type",
          "params"
        ],
        "type": "object"
      },
      "IncreaseBudgetActionParameters": {
        "additionalProperties": false,
        "description": "Increase parameters with an explicit account-currency ceiling.",
        "properties": {
          "mode": {
            "enum": [
              "percent",
              "absolute"
            ],
            "type": "string"
          },
          "value": {
            "description": "Percent when mode is percent; major account-currency units when absolute.",
            "exclusiveMinimum": 0,
            "type": "number"
          },
          "max_daily_budget": {
            "description": "Maximum allowed budget in major account-currency units (for USD, 100 means $100).",
            "exclusiveMinimum": 0,
            "type": "number"
          }
        },
        "required": [
          "mode",
          "value",
          "max_daily_budget"
        ],
        "type": "object"
      },
      "IncreaseBudgetRuleAction": {
        "additionalProperties": false,
        "description": "Budget increase that cannot exceed its mandatory ceiling.",
        "properties": {
          "type": {
            "const": "increase_budget",
            "type": "string"
          },
          "params": {
            "$ref": "#/$defs/IncreaseBudgetActionParameters"
          }
        },
        "required": [
          "type",
          "params"
        ],
        "type": "object"
      },
      "MetricReferenceInput": {
        "additionalProperties": false,
        "description": "Immutable provider metric selector.",
        "properties": {
          "id": {
            "$ref": "#/$defs/RuleMetricId"
          },
          "source_metric": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "action_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "attribution_window": {
            "default": "value",
            "enum": [
              "value",
              "1d_click",
              "7d_click",
              "1d_view"
            ],
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "MetricTimeframeInput": {
        "additionalProperties": false,
        "description": "Today or bounded rolling-day window.",
        "properties": {
          "kind": {
            "enum": [
              "today",
              "rolling_days"
            ],
            "type": "string"
          },
          "days": {
            "default": 1,
            "maximum": 365,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "OtherRuleAction": {
        "additionalProperties": false,
        "description": "One non-relative-budget action validated again by Core.",
        "properties": {
          "type": {
            "enum": [
              "set_budget",
              "set_status",
              "add_tag",
              "remove_tag",
              "replace_tag",
              "edit_name",
              "duplicate"
            ],
            "type": "string"
          },
          "params": {
            "additionalProperties": true,
            "type": "object"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "RuleAction": {
        "discriminator": {
          "mapping": {
            "add_tag": "#/$defs/OtherRuleAction",
            "decrease_budget": "#/$defs/DecreaseBudgetRuleAction",
            "duplicate": "#/$defs/OtherRuleAction",
            "edit_name": "#/$defs/OtherRuleAction",
            "increase_budget": "#/$defs/IncreaseBudgetRuleAction",
            "remove_tag": "#/$defs/OtherRuleAction",
            "replace_tag": "#/$defs/OtherRuleAction",
            "set_budget": "#/$defs/OtherRuleAction",
            "set_status": "#/$defs/OtherRuleAction"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/$defs/IncreaseBudgetRuleAction"
          },
          {
            "$ref": "#/$defs/DecreaseBudgetRuleAction"
          },
          {
            "$ref": "#/$defs/OtherRuleAction"
          }
        ]
      },
      "RuleCreate": {
        "additionalProperties": false,
        "description": "Complete canonical rule create request.",
        "properties": {
          "request_id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "provider": {
            "default": "meta",
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "status": {
            "default": "draft",
            "enum": [
              "draft",
              "active",
              "paused"
            ],
            "type": "string"
          },
          "ad_account_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "type": "array"
          },
          "level": {
            "$ref": "#/$defs/RuleTargetLevel",
            "default": "ad"
          },
          "target_filter": {
            "$ref": "#/$defs/TargetFilterGroup"
          },
          "tasks": {
            "items": {
              "$ref": "#/$defs/RuleTask"
            },
            "maxItems": 20,
            "minItems": 1,
            "type": "array"
          },
          "schedule": {
            "$ref": "#/$defs/RuleSchedule"
          },
          "execution_limit": {
            "anyOf": [
              {
                "$ref": "#/$defs/RuleExecutionLimit"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "dry_run": {
            "default": true,
            "type": "boolean"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          }
        },
        "required": [
          "request_id",
          "name",
          "ad_account_ids",
          "target_filter",
          "tasks",
          "schedule"
        ],
        "type": "object"
      },
      "RuleExecutionLimit": {
        "additionalProperties": false,
        "description": "Per-rule/per-asset execution capacity inside a rolling window.",
        "properties": {
          "max_executions": {
            "maximum": 100000,
            "minimum": 1,
            "type": "integer"
          },
          "window_seconds": {
            "maximum": 31536000,
            "minimum": 1,
            "type": "integer"
          },
          "scope": {
            "const": "rule_asset",
            "default": "rule_asset",
            "type": "string"
          }
        },
        "required": [
          "max_executions",
          "window_seconds"
        ],
        "type": "object"
      },
      "RuleMetricId": {
        "enum": [
          "spend",
          "impressions",
          "frequency",
          "cpm",
          "inline_link_clicks",
          "meta.action:landing_page_view",
          "ctr",
          "cpc",
          "leads",
          "add_to_carts",
          "meta.action:initiate_checkout",
          "purchases",
          "purchase_value",
          "cpa",
          "roas"
        ],
        "minLength": 1,
        "type": "string"
      },
      "RuleSchedule": {
        "additionalProperties": false,
        "description": "Validated cron schedule and IANA timezone.",
        "properties": {
          "cron": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "timezone": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "cron",
          "timezone"
        ],
        "type": "object"
      },
      "RuleTargetLevel": {
        "description": "Advertising hierarchy levels that rules may target.",
        "enum": [
          "campaign",
          "adset",
          "ad"
        ],
        "type": "string"
      },
      "RuleTask": {
        "additionalProperties": false,
        "description": "Ordered first-match rule task.",
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 300,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "active_only": {
            "default": true,
            "type": "boolean"
          },
          "conditions": {
            "$ref": "#/$defs/ConditionNode"
          },
          "actions": {
            "items": {
              "$ref": "#/$defs/RuleAction"
            },
            "maxItems": 10,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "id",
          "conditions",
          "actions"
        ],
        "type": "object"
      },
      "TargetFilterGroup": {
        "additionalProperties": false,
        "description": "Nested target predicates.",
        "properties": {
          "kind": {
            "const": "group",
            "default": "group",
            "type": "string"
          },
          "combinator": {
            "default": "and",
            "enum": [
              "and",
              "or"
            ],
            "type": "string"
          },
          "children": {
            "items": {
              "discriminator": {
                "mapping": {
                  "filter": "#/$defs/TargetFilterPredicate",
                  "group": "#/$defs/TargetFilterGroup"
                },
                "propertyName": "kind"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/TargetFilterPredicate"
                },
                {
                  "$ref": "#/$defs/TargetFilterGroup"
                }
              ]
            },
            "maxItems": 50,
            "type": "array"
          }
        },
        "type": "object"
      },
      "TargetFilterPredicate": {
        "additionalProperties": false,
        "description": "One provider-neutral target predicate.",
        "properties": {
          "kind": {
            "const": "filter",
            "type": "string"
          },
          "attribute": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "operator": {
            "maxLength": 50,
            "minLength": 1,
            "type": "string"
          },
          "value": {},
          "scope": {
            "default": "self",
            "enum": [
              "self",
              "ancestor"
            ],
            "type": "string"
          },
          "level": {
            "anyOf": [
              {
                "$ref": "#/$defs/RuleTargetLevel"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "required": [
          "kind",
          "attribute",
          "operator",
          "value"
        ],
        "type": "object"
      }
    },
    "additionalProperties": false,
    "properties": {
      "payload": {
        "$ref": "#/$defs/RuleCreate",
        "type": "object"
      }
    },
    "required": [
      "payload"
    ],
    "type": "object"
  }
  ```
</Accordion>

<span id="rules-update" />

## rules\_update

Replace one rule; first read it and preserve every unchanged field.

**Access:** `mcp:read` and `mcp:write`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `rule_id` | uuid | Required | Rule UUID from `rules_list`. |
| `payload` | object | Required | |

### payload fields

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `request_id` | uuid | Required | UUID for this operation; use a new UUID for changed inputs. |
| `name` | string | Required | minLength: `1`. maxLength: `300`. |
| `provider` | string | `"meta"` | minLength: `1`. maxLength: `64`. |
| `status` | draft, active, paused | `"draft"` | |
| `ad_account_ids` | array of uuid | Required | minItems: `1`. maxItems: `20`. |
| `level` | campaign, adset, ad | `"ad"` | Advertising hierarchy levels that rules may target. |
| `target_filter` | object | Required | Nested target predicates. |
| `tasks` | array of object | Required | minItems: `1`. maxItems: `20`. |
| `schedule` | object | Required | Validated cron schedule and IANA timezone. |
| `execution_limit` | object or null | `null` | |
| `dry_run` | boolean | `true` | `true` checks the request without making live changes in Meta. |
| `metadata` | object | Optional | |
| `expected_version` | integer | Required | minimum: `1`. |

**Retries:** after a timeout, read the current state before submitting again to avoid duplicate changes.

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "$defs": {
      "ConditionNode": {
        "additionalProperties": false,
        "description": "Condition or group node with explicit discriminating kind.",
        "properties": {
          "kind": {
            "enum": [
              "condition",
              "group"
            ],
            "type": "string"
          },
          "metric": {
            "anyOf": [
              {
                "$ref": "#/$defs/MetricReferenceInput"
              },
              {
                "$ref": "#/$defs/RuleMetricId"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "timeframe": {
            "anyOf": [
              {
                "$ref": "#/$defs/MetricTimeframeInput"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "operator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "value": {
            "default": null,
            "title": "Value"
          },
          "combinator": {
            "anyOf": [
              {
                "enum": [
                  "and",
                  "or"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "children": {
            "items": {
              "$ref": "#/$defs/ConditionNode"
            },
            "maxItems": 50,
            "type": "array"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "DecreaseBudgetActionParameters": {
        "additionalProperties": false,
        "description": "Decrease parameters with an explicit account-currency floor.",
        "properties": {
          "mode": {
            "enum": [
              "percent",
              "absolute"
            ],
            "type": "string"
          },
          "value": {
            "description": "Percent when mode is percent; major account-currency units when absolute.",
            "exclusiveMinimum": 0,
            "type": "number"
          },
          "min_daily_budget": {
            "description": "Minimum allowed budget in major account-currency units (for USD, 100 means $100).",
            "exclusiveMinimum": 0,
            "type": "number"
          }
        },
        "required": [
          "mode",
          "value",
          "min_daily_budget"
        ],
        "type": "object"
      },
      "DecreaseBudgetRuleAction": {
        "additionalProperties": false,
        "description": "Budget decrease that cannot fall below its mandatory floor.",
        "properties": {
          "type": {
            "const": "decrease_budget",
            "type": "string"
          },
          "params": {
            "$ref": "#/$defs/DecreaseBudgetActionParameters"
          }
        },
        "required": [
          "type",
          "params"
        ],
        "type": "object"
      },
      "IncreaseBudgetActionParameters": {
        "additionalProperties": false,
        "description": "Increase parameters with an explicit account-currency ceiling.",
        "properties": {
          "mode": {
            "enum": [
              "percent",
              "absolute"
            ],
            "type": "string"
          },
          "value": {
            "description": "Percent when mode is percent; major account-currency units when absolute.",
            "exclusiveMinimum": 0,
            "type": "number"
          },
          "max_daily_budget": {
            "description": "Maximum allowed budget in major account-currency units (for USD, 100 means $100).",
            "exclusiveMinimum": 0,
            "type": "number"
          }
        },
        "required": [
          "mode",
          "value",
          "max_daily_budget"
        ],
        "type": "object"
      },
      "IncreaseBudgetRuleAction": {
        "additionalProperties": false,
        "description": "Budget increase that cannot exceed its mandatory ceiling.",
        "properties": {
          "type": {
            "const": "increase_budget",
            "type": "string"
          },
          "params": {
            "$ref": "#/$defs/IncreaseBudgetActionParameters"
          }
        },
        "required": [
          "type",
          "params"
        ],
        "type": "object"
      },
      "MetricReferenceInput": {
        "additionalProperties": false,
        "description": "Immutable provider metric selector.",
        "properties": {
          "id": {
            "$ref": "#/$defs/RuleMetricId"
          },
          "source_metric": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "action_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "attribution_window": {
            "default": "value",
            "enum": [
              "value",
              "1d_click",
              "7d_click",
              "1d_view"
            ],
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "MetricTimeframeInput": {
        "additionalProperties": false,
        "description": "Today or bounded rolling-day window.",
        "properties": {
          "kind": {
            "enum": [
              "today",
              "rolling_days"
            ],
            "type": "string"
          },
          "days": {
            "default": 1,
            "maximum": 365,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "OtherRuleAction": {
        "additionalProperties": false,
        "description": "One non-relative-budget action validated again by Core.",
        "properties": {
          "type": {
            "enum": [
              "set_budget",
              "set_status",
              "add_tag",
              "remove_tag",
              "replace_tag",
              "edit_name",
              "duplicate"
            ],
            "type": "string"
          },
          "params": {
            "additionalProperties": true,
            "type": "object"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "RuleAction": {
        "discriminator": {
          "mapping": {
            "add_tag": "#/$defs/OtherRuleAction",
            "decrease_budget": "#/$defs/DecreaseBudgetRuleAction",
            "duplicate": "#/$defs/OtherRuleAction",
            "edit_name": "#/$defs/OtherRuleAction",
            "increase_budget": "#/$defs/IncreaseBudgetRuleAction",
            "remove_tag": "#/$defs/OtherRuleAction",
            "replace_tag": "#/$defs/OtherRuleAction",
            "set_budget": "#/$defs/OtherRuleAction",
            "set_status": "#/$defs/OtherRuleAction"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/$defs/IncreaseBudgetRuleAction"
          },
          {
            "$ref": "#/$defs/DecreaseBudgetRuleAction"
          },
          {
            "$ref": "#/$defs/OtherRuleAction"
          }
        ]
      },
      "RuleExecutionLimit": {
        "additionalProperties": false,
        "description": "Per-rule/per-asset execution capacity inside a rolling window.",
        "properties": {
          "max_executions": {
            "maximum": 100000,
            "minimum": 1,
            "type": "integer"
          },
          "window_seconds": {
            "maximum": 31536000,
            "minimum": 1,
            "type": "integer"
          },
          "scope": {
            "const": "rule_asset",
            "default": "rule_asset",
            "type": "string"
          }
        },
        "required": [
          "max_executions",
          "window_seconds"
        ],
        "type": "object"
      },
      "RuleMetricId": {
        "enum": [
          "spend",
          "impressions",
          "frequency",
          "cpm",
          "inline_link_clicks",
          "meta.action:landing_page_view",
          "ctr",
          "cpc",
          "leads",
          "add_to_carts",
          "meta.action:initiate_checkout",
          "purchases",
          "purchase_value",
          "cpa",
          "roas"
        ],
        "minLength": 1,
        "type": "string"
      },
      "RuleSchedule": {
        "additionalProperties": false,
        "description": "Validated cron schedule and IANA timezone.",
        "properties": {
          "cron": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "timezone": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "cron",
          "timezone"
        ],
        "type": "object"
      },
      "RuleTargetLevel": {
        "description": "Advertising hierarchy levels that rules may target.",
        "enum": [
          "campaign",
          "adset",
          "ad"
        ],
        "type": "string"
      },
      "RuleTask": {
        "additionalProperties": false,
        "description": "Ordered first-match rule task.",
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 300,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "active_only": {
            "default": true,
            "type": "boolean"
          },
          "conditions": {
            "$ref": "#/$defs/ConditionNode"
          },
          "actions": {
            "items": {
              "$ref": "#/$defs/RuleAction"
            },
            "maxItems": 10,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "id",
          "conditions",
          "actions"
        ],
        "type": "object"
      },
      "RuleUpdate": {
        "additionalProperties": false,
        "properties": {
          "request_id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "provider": {
            "default": "meta",
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "status": {
            "default": "draft",
            "enum": [
              "draft",
              "active",
              "paused"
            ],
            "type": "string"
          },
          "ad_account_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "type": "array"
          },
          "level": {
            "$ref": "#/$defs/RuleTargetLevel",
            "default": "ad"
          },
          "target_filter": {
            "$ref": "#/$defs/TargetFilterGroup"
          },
          "tasks": {
            "items": {
              "$ref": "#/$defs/RuleTask"
            },
            "maxItems": 20,
            "minItems": 1,
            "type": "array"
          },
          "schedule": {
            "$ref": "#/$defs/RuleSchedule"
          },
          "execution_limit": {
            "anyOf": [
              {
                "$ref": "#/$defs/RuleExecutionLimit"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "dry_run": {
            "default": true,
            "type": "boolean"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "expected_version": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "request_id",
          "name",
          "ad_account_ids",
          "target_filter",
          "tasks",
          "schedule",
          "expected_version"
        ],
        "type": "object"
      },
      "TargetFilterGroup": {
        "additionalProperties": false,
        "description": "Nested target predicates.",
        "properties": {
          "kind": {
            "const": "group",
            "default": "group",
            "type": "string"
          },
          "combinator": {
            "default": "and",
            "enum": [
              "and",
              "or"
            ],
            "type": "string"
          },
          "children": {
            "items": {
              "discriminator": {
                "mapping": {
                  "filter": "#/$defs/TargetFilterPredicate",
                  "group": "#/$defs/TargetFilterGroup"
                },
                "propertyName": "kind"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/TargetFilterPredicate"
                },
                {
                  "$ref": "#/$defs/TargetFilterGroup"
                }
              ]
            },
            "maxItems": 50,
            "type": "array"
          }
        },
        "type": "object"
      },
      "TargetFilterPredicate": {
        "additionalProperties": false,
        "description": "One provider-neutral target predicate.",
        "properties": {
          "kind": {
            "const": "filter",
            "type": "string"
          },
          "attribute": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "operator": {
            "maxLength": 50,
            "minLength": 1,
            "type": "string"
          },
          "value": {},
          "scope": {
            "default": "self",
            "enum": [
              "self",
              "ancestor"
            ],
            "type": "string"
          },
          "level": {
            "anyOf": [
              {
                "$ref": "#/$defs/RuleTargetLevel"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "required": [
          "kind",
          "attribute",
          "operator",
          "value"
        ],
        "type": "object"
      }
    },
    "additionalProperties": false,
    "properties": {
      "rule_id": {
        "format": "uuid",
        "type": "string"
      },
      "payload": {
        "$ref": "#/$defs/RuleUpdate",
        "type": "object"
      }
    },
    "required": [
      "rule_id",
      "payload"
    ],
    "type": "object"
  }
  ```
</Accordion>

<span id="rules-change-status" />

## rules\_change\_status

Set a rule to draft, active, or paused using its current version.

**Access:** `mcp:read` and `mcp:write`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `rule_id` | uuid | Required | Rule UUID from `rules_list`. |
| `expected_version` | integer | Required | Current version from the latest read; prevents overwriting another edit. |
| `status` | string | Required | |
| `request_id` | uuid | Required | UUID for this operation; use a new UUID for changed inputs. |

**Retries:** after a timeout, read the current state before submitting again to avoid duplicate changes.

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "rule_id": {
        "format": "uuid",
        "type": "string"
      },
      "expected_version": {
        "type": "integer"
      },
      "status": {
        "type": "string"
      },
      "request_id": {
        "format": "uuid",
        "type": "string"
      }
    },
    "required": [
      "rule_id",
      "expected_version",
      "status",
      "request_id"
    ],
    "type": "object"
  }
  ```
</Accordion>

<span id="rules-delete" />

## rules\_delete

Archive one authorized rule.

**Access:** `mcp:read` and `mcp:write`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `rule_id` | uuid | Required | Rule UUID from `rules_list`. |
| `expected_version` | integer | Required | Current version from the latest read; prevents overwriting another edit. |
| `request_id` | uuid | Required | UUID for this operation; use a new UUID for changed inputs. |

**Retries:** after a timeout, read the current state before submitting again to avoid duplicate changes.

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "rule_id": {
        "format": "uuid",
        "type": "string"
      },
      "expected_version": {
        "type": "integer"
      },
      "request_id": {
        "format": "uuid",
        "type": "string"
      }
    },
    "required": [
      "rule_id",
      "expected_version",
      "request_id"
    ],
    "type": "object"
  }
  ```
</Accordion>

<span id="rules-changes" />

## rules\_changes

Read the saved change history for a rule.

**Access:** `mcp:read`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `rule_id` | uuid | Required | Rule UUID from `rules_list`. |
| `limit` | integer | `25` | |

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "rule_id": {
        "format": "uuid",
        "type": "string"
      },
      "limit": {
        "default": 25,
        "type": "integer"
      }
    },
    "required": [
      "rule_id"
    ],
    "type": "object"
  }
  ```
</Accordion>

<span id="rules-run" />

## rules\_run

Submit a rule run and return its ID for tracking. The run continues after the tool call returns.

**Access:** `mcp:read` and `mcp:write`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `rule_id` | uuid | Required | Rule UUID from `rules_list`. |
| `version` | integer | Required | |
| `request_id` | uuid | Required | UUID for this operation; use a new UUID for changed inputs. |
| `dry_run` | boolean | `true` | `true` checks the request without making live changes in Meta. |

**Retries:** reuse the same `request_id` with unchanged inputs for the same operation.

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "rule_id": {
        "format": "uuid",
        "type": "string"
      },
      "version": {
        "type": "integer"
      },
      "request_id": {
        "format": "uuid",
        "type": "string"
      },
      "dry_run": {
        "default": true,
        "type": "boolean"
      }
    },
    "required": [
      "rule_id",
      "version",
      "request_id"
    ],
    "type": "object"
  }
  ```
</Accordion>

<span id="rule-runs-list" />

## rule\_runs\_list

List authorized rule runs.

**Access:** `mcp:read`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `limit` | integer | `25` | |

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "limit": {
        "default": 25,
        "type": "integer"
      }
    },
    "type": "object"
  }
  ```
</Accordion>

<span id="rule-runs-get" />

## rule\_runs\_get

Read one authorized rule run.

**Access:** `mcp:read`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `run_id` | uuid | Required | |

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "run_id": {
        "format": "uuid",
        "type": "string"
      }
    },
    "required": [
      "run_id"
    ],
    "type": "object"
  }
  ```
</Accordion>

<span id="rule-activity-list" />

## rule\_activity\_list

List authorized rule activity records.

**Access:** `mcp:read`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `limit` | integer | `25` | |

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "limit": {
        "default": 25,
        "type": "integer"
      }
    },
    "type": "object"
  }
  ```
</Accordion>

<span id="rule-activity-get" />

## rule\_activity\_get

Read one authorized rule activity record.

**Access:** `mcp:read`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `activity_id` | uuid | Required | Activity UUID from the tool result or `activity_list`. |

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "activity_id": {
        "format": "uuid",
        "type": "string"
      }
    },
    "required": [
      "activity_id"
    ],
    "type": "object"
  }
  ```
</Accordion>

<span id="rule-activity-summary" />

## rule\_activity\_summary

Summarize activity for one rule.

**Access:** `mcp:read`.

| Parameter | Type | Required / default | Details |
| - | - | - | - |
| `rule_id` | uuid | Required | Rule UUID from `rules_list`. |

<Accordion title="Full input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "rule_id": {
        "format": "uuid",
        "type": "string"
      }
    },
    "required": [
      "rule_id"
    ],
    "type": "object"
  }
  ```
</Accordion>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.