# set_form_rules

> Replace a document's whole skip-rule list, in order, as the app's Detect step saves it when a person edits, removes or adds a rule on a question.

Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first.

Replace a document's whole skip-rule list, in order, as the app's Detect step saves it when a person edits, removes or adds a rule on a question. Call get_form_rules first and send back every rule you keep: a rule left out is removed (rules: [] removes them all). Keep a rule's id to keep where it came from (the form's printed words); a changed or new rule (no id) becomes the person's own. Each rule: group_id (a choice question from list_groups), option_values (that question's option values that trigger it), skip (section ids from get_form_rules not needed then) and/or goto (the section id to go to next). A rule must skip something or go somewhere, and can't only skip its own question (422 with the reason otherwise). Returns the saved list in get_form_rules' shape. sections[] are the form's parts and numbered questions ({ id, kind: part|question, label, number, parent_id }); rules[] are its skip logic, in order: when the choice question group_id is answered with one of option_values, the sections in skip[] are not needed and goto (a section id, or null) is where the form sends the reader next. source is page_text (read from the form's printed words), llm, or manual (a person's).

## Inputs

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `document_id` | string | yes | The document's id |
| `rules` | object[] | yes | Up to 500 items |
| `rules[].id` | string | no | Keep an existing rule's id (from get_form_rules); omit for a new rule. Up to 64 characters |
| `rules[].group_id` | string | yes | The choice question that triggers it. Up to 64 characters |
| `rules[].option_values` | string[] | yes | 1 to 50 items |
| `rules[].skip` | string[] | no | Section ids not needed when it fires (default []). Up to 200 items |
| `rules[].goto` | string \| null | no | Section id the form sends the reader to next. Up to 128 characters |
