Skip to Content

insert_clause

Put a clause from the workspace's clause library (search_clauses) into a Doc, word for word, as Insert clause in the editor does.

asks firstChanges something in your workspace, so clients ask you before running it.

What it does

Put a clause from the workspace's clause library (search_clauses) into a Doc, word for word, as Insert clause in the editor does. It goes after the block whose text you give in after (a heading means after its whole section), or at the end. The clause stays linked to the library, so a newer version can update it later. Saves the Doc and returns its new revision and the text inserted. No AI is used. To write a new clause instead use docs_ai_continue with kind clause.

Inputs

NameTypeDescription
doc_idrequiredstringThe Doc's id (from list_docs or get_doc).Up to 80 characters
clause_idrequiredstringclause_id from search_clauses.Up to 80 characters
afterstringPut it after the block with this text, copied from the Doc (a heading like "4. Fees" means after its whole section). Leave out for the end of the Doc.Up to 200 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": "insert_clause",
    "arguments": {
      "doc_id": "<doc_id>",
      "clause_id": "<clause_id>"
    }
  }
}

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)."
    },
    "clause_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "clause_id from search_clauses."
    },
    "after": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Put it after the block with this text, copied from the Doc (a heading like \"4. Fees\" means after its whole section). Leave out for the end of the Doc."
    },
    "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",
    "clause_id"
  ],
  "additionalProperties": false
}

On this page