Skip to Content

docs_ai_rewrite

Rewrite part of a Doc with AppliFlo's AI and replace it in the Doc, as selecting text and choosing Rewrite in the editor does. text is the exact words to rewrite, copied from the Doc as get_doc shows it (may span paragraphs); mode plainer, firmer, shorter, longer or grammar, or custom with an instruction.

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

What it does

Rewrite part of a Doc with AppliFlo's AI and replace it in the Doc, as selecting text and choosing Rewrite in the editor does. text is the exact words to rewrite, copied from the Doc as get_doc shows it (may span paragraphs); mode plainer, firmer, shorter, longer or grammar, or custom with an instruction. Variables, fill-in boxes and signatures in it keep their settings. Saves the Doc and returns its new revision, the new text and checks. Spends the workspace's AI writing allowance (Starter and Business plans); refused like the app (ai_disabled, ai_plan, ai_rate_limited, ai_budget_reached). To only explain text use docs_ai_explain; to find what needs fixing use docs_ai_review.

Inputs

NameTypeDescription
doc_idrequiredstringThe Doc's id (from list_docs or get_doc).Up to 80 characters
textrequiredstringThe exact text to rewrite, copied from the Doc (a review finding's text works).Up to 12000 characters
moderequiredstringHow to rewrite it; custom needs an instruction.One of: plainer, firmer, shorter, longer, grammar, custom
instructionstringFor custom: how to rewrite it, in the person's words (or a review finding's fix).Up to 1000 characters
revisionintegerThe Doc's revision as you last read it (get_doc). Checked before any AI is spent: if the Doc has changed since, you get 409 revision_conflict with the current revision and nothing is spent or written. The tool holds the Doc's edit lock from that check until it has saved, so nobody can change it in between. Leave out to work on the Doc as it is now.At least 0

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": "docs_ai_rewrite",
    "arguments": {
      "doc_id": "<doc_id>",
      "text": "<text>",
      "mode": "plainer"
    }
  }
}

Input schema

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

{
  "type": "object",
  "properties": {
    "doc_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "The Doc's id (from list_docs or get_doc)."
    },
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 12000,
      "description": "The exact text to rewrite, copied from the Doc (a review finding's text works)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "plainer",
        "firmer",
        "shorter",
        "longer",
        "grammar",
        "custom"
      ],
      "description": "How to rewrite it; custom needs an instruction."
    },
    "instruction": {
      "type": "string",
      "maxLength": 1000,
      "description": "For custom: how to rewrite it, in the person's words (or a review finding's fix)."
    },
    "revision": {
      "type": "integer",
      "minimum": 0,
      "description": "The Doc's revision as you last read it (get_doc). Checked before any AI is spent: if the Doc has changed since, you get 409 revision_conflict with the current revision and nothing is spent or written. The tool holds the Doc's edit lock from that check until it has saved, so nobody can change it in between. Leave out to work on the Doc as it is now."
    }
  },
  "required": [
    "doc_id",
    "text",
    "mode"
  ],
  "additionalProperties": false
}

On this page