MCP tools
Edit structure template rules
Update an existing structure template's rules/audiences/settings.
Tool name: edit-structure-template-rules.
Update an existing structure template's rules/audiences/settings. Pass the full new StructureState in config (validated before save). Omit templateId to edit the template open in the builder. WRITE.
When to use
Apply a natural-language edit to a template by recomputing its StructureState and saving. Falls back to the bound structureTemplateId.
Access
| Property | Value |
|---|---|
| Required scope | write |
| Publishes | No |
| Read-only | No |
| Destructive | Yes |
| Idempotent | No |
| Open world | No |
Input
| Field | Type | Required | Description |
|---|---|---|---|
templateId | string | No | Structure template ID. Omit to read the template currently open in the builder from the Current Context block. Pass an explicit id only when acting on a different template than the one in scope. |
name | string | No | |
config | object | No | |
config.countMode | string | Yes | dynamic = use the real attached-creative count at apply; fixed = exactly n. One of dynamic, fixed. |
config.n | integer | Yes | creative count (for dynamic, a placeholder the engine substitutes at apply). Maximum 1000. |
config.adsets | string | Yes | fixed = exactly k sets; distributed = ceil(n/per) sets of per. One of fixed, distributed. |
config.k | integer | Yes | number of ad sets when adsets=fixed (clamped 1..20). Maximum 20. |
config.per | integer | Yes | creatives per set when adsets=distributed. Maximum 20. |
config.placement | string | Yes | fixed-adsets only: broadcast = every set gets every creative; split = partition. One of broadcast, split. |
config.splitMode | string | Yes | One of even, weighted, roundrobin. |
config.weights | number[] | null | Yes | At most 20 items. |
config.name | string | Yes | |
config.ops | object[] | null | Yes | fixed-N custom drag-drop ops: clone/move/remove/group/addset |
config.remainderPolicy | string | No | One of frontload, lastset, drop. |
config.minPerSet | integer | No | Minimum 0, maximum 50. |
config.maxPerSet | integer | No | Minimum 0, maximum 50. |
audiences | object[] | No | Template-level audiences (targetingSet | customAudience | savedAudience). At least one is required to save or apply. |
settings | object | No | |
scope | string | No | One of single, multiple. |
status | string | No | One of DRAFT, READY, NEEDS_ATTENTION. |
accounts | object[] | No | |
accounts[].adAccountId | string | Yes | |
accounts[].settings | object | No | |
accounts[].status | string | No |
Output
The tool catalog does not declare an output schema for this tool.
REST equivalent
PATCH /v1/brands/{brandId}/structure-templates/{templateId}, Edit structure template rules. CLI: koast edit-structure-template-rules.