Skip to Content

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.

destructiveSends, cancels or emails people. Clients ask you before running it.

What it does

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

NameTypeDescription
document_idrequiredstringThe document's id.
rulesrequiredobject[]Up to 500 items
idstringKeep an existing rule's id (from get_form_rules); omit for a new rule.Up to 64 characters
group_idrequiredstringThe choice question that triggers it.Up to 64 characters
option_valuesrequiredstring[]1 to 50 items
skipstring[]Section ids not needed when it fires (default []).Up to 200 items
gotostring | nullSection id the form sends the reader to next.Up to 128 characters

Call it

Your MCP client builds this request for you. This is what it sends to https://appliflo.com/api/mcp, with the required inputs filled with placeholders.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "set_form_rules",
    "arguments": {
      "document_id": "<document_id>",
      "rules": []
    }
  }
}

Input schema

The JSON Schema the server lists for this tool in tools/list.

{
  "type": "object",
  "properties": {
    "document_id": {
      "type": "string",
      "description": "The document's id."
    },
    "rules": {
      "type": "array",
      "maxItems": 500,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Keep an existing rule's id (from get_form_rules); omit for a new rule."
          },
          "group_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The choice question that triggers it."
          },
          "option_values": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "skip": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "description": "Section ids not needed when it fires (default [])."
          },
          "goto": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 128,
            "description": "Section id the form sends the reader to next."
          }
        },
        "required": [
          "group_id",
          "option_values"
        ]
      }
    }
  },
  "required": [
    "document_id",
    "rules"
  ]
}

On this page