Skip to main content
Glama

Update an ebook

update_ebook
Destructive

Edit an existing Unplain ebook: its design, its cover, its table of contents, its CTA page, the dashboard name, and the body. RESTYLING happens here, not through separate setters: 'brandThemeId', then 'preset', then 'theme' (individual colours, fonts, type sizes and spacing), then 'cover.style', applied in that order in one atomic write, so "make it feel like an independent literary journal" is a single call. get_design_options lists the valid values; get_ebook reports the current ones under theme.design, in the same field names this tool accepts. 'cta' is the CTA page Unplain adds at the end: its layout, headline, body, button label, link and showButton switch (false, or an empty label, hides the button), social links and the footer credit switch, the same fields as the editor's CTA settings. A shown button needs a real url: with none, one Unplain cannot link to, or the placeholder https://example.com it is left out of the PDF, and warnings say so. Send only the keys to change; the rest stay as they are. Edit the body EITHER with 'operations' (precise block edits by block id, from get_ebook, applied atomically) OR with 'content' (replace the whole body with new Markdown), never both. Operations also insert a table or a button (insert_after), rewrite a table (set_table), turn a paragraph, heading, subheading or quote into another of those (convert_block), copy a block (duplicate_block), set an image's size, alignment, alt text or caption (set_image), and replace exact text across the ebook or in one block (replace_text). insert_after and duplicate_block may name the new block with ref; later operations in the same call address it as "ref:", and the result returns insertedBlockIds and refs with the real ids. Prefer operations to 'content' whenever the ebook has tables, images or buttons: replacing the body rebuilds every block and deletes stored images. cover.image: null removes the cover image. Pass the 'version' from get_ebook so the update is rejected rather than silently overwriting a change made in the web app in the meantime. Nothing is written unless every part of the call is valid.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectId": "<projectId>"
    },
    "name": "update_ebook"
  }
}

Input Schema

NameRequiredDescriptionDefault
ctaNoThe CTA page Unplain adds at the end of the ebook: its layout, headline, body, button (and whether it is shown), the address the button opens, the social links and the footer credit switch. Unplain writes this page, so it takes no part of the document. Send only what should change; every key left out stays as it is.
tocNoTable of contents. A guide of more than a few sections reads better with one.
nameNodashboard name
coverNo
themeNoIndividual theme properties for THIS ebook only, applied on top of any preset or Brand Theme in the same call. Every field is optional; send only what you want to change.
titleNo
authorNo
footerNoThe page footer. Its look is theme.footerStyle.
presetNoApply a built-in Unplain preset as the starting look (colors, fonts, type scale, corner radius, cover layout, footer). Content is never touched. Combine with 'theme' to adjust individual properties on top. See get_design_options for what each preset looks like.
contentNoreplace the entire body with this Markdown. Cannot be combined with operations.
versionNothe version returned by get_ebook. Strongly recommended: the update is then rejected rather than applied if the ebook changed in the meantime.
subtitleNo
projectIdYes
operationsNoblock-level edits, applied in order and atomically. A block rewritten with set_text or set_items keeps its treatment (see get_ebook) only if the new text still qualifies, for example a stat must stay a short figure like "47%" or "$2.4M ARR"; otherwise it returns to standard styling and warnings name it. A statCaption also loses its treatment when the block above it stops being its stat (rewritten, deleted, moved, or a block inserted between). No operation adds a treatment.
brandThemeIdNoApply one of the caller's saved Brand Themes, from list_brand_themes: its colors, fonts, logo and social links. Use this when the user says "my brand" or names their company. Applied BEFORE preset and theme, so those can adjust it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / cta / description
      Previous value: -"The CTA page Unplain adds at the end of the ebook: its layout, headline, body, button (and whether it is shown), the address the button opens, the social links and the footer credit switch. Unplain writes this page, so it takes no part of the document and never counts toward the free plan's page limit. Send only what should change; every key left out stays as it is."New value: +"The CTA page Unplain adds at the end of the ebook: its layout, headline, body, button (and whether it is shown), the address the button opens, the social links and the footer credit switch. Unplain writes this page, so it takes no part of the document. Send only what should change; every key left out stays as it is."
    • changedInput schema / properties / cta / properties / showBadge / description
      Previous value: -"Whether the page footers carry the small \"Made with Unplain\" credit (it is never on the CTA page). Free plan exports always carry it; Pro and Creator Pack exports follow this."New value: +"Whether the page footers carry the small \"Made with Unplain\" credit (it is never on the CTA page). Free plan exports always carry it; Growth and Creator Pack exports follow this."
  2. Changed1 schema field changed
    • addedInput schema / properties / footer
      Added value: +{
      +  "description": "The page footer. Its look is theme.footerStyle.",
      +  "properties": {
      +    "pageNumbers": {
      +      "description": "Whether the footer shows page numbers.",
      +      "type": "boolean"
      +    },
      +    "show": {
      +      "description": "Whether pages draw a footer at all.",
      +      "type": "boolean"
      +    },
      +    "text": {
      +      "description": "The footer's text, for example the company name. '' clears it. A footer logo replaces it.",
      +      "maxLength": 80,
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / cover / properties / image
      Added value: +{
      +  "description": "null removes the cover image (get_ebook reports cover.hasImage). A new cover image is added in the Unplain editor.",
      +  "type": "null"
      +}
    • changedInput schema / properties / operations / items / oneOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "blockId": {
      -        "maxLength": 64,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "op": {
      -        "const": "set_text",
      -        "type": "string"
      -      },
      -      "text": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "op",
      -      "blockId",
      -      "text"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "blockId": {
      -        "maxLength": 64,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "items": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "maxItems": 200,
      -        "minItems": 1,
      -        "type": "array"
      -      },
      -      "op": {
      -        "const": "set_items",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "op",
      -      "blockId",
      -      "items"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "blockId": {
      -        "maxLength": 64,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "level": {
      -        "anyOf": [
      -          {
      -            "const": 1,
      -            "type": "number"
      -          },
      -          {
      -            "const": 2,
      -            "type": "number"
      -          },
      -          {
      -            "const": 3,
      -            "type": "number"
      -          }
      -        ]
      -      },
      -      "op": {
      -        "const": "set_heading_level",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "op",
      -      "blockId",
      -      "level"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "afterBlockId": {
      -        "description": "omit to insert at the very start of the ebook",
      -        "maxLength": 64,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "block": {
      -        "properties": {
      -          "items": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "maxItems": 200,
      -            "type": "array"
      -          },
      -          "level": {
      -            "anyOf": [
      -              {
      -                "const": 1,
      -                "type": "number"
      -              },
      -              {
      -                "const": 2,
      -                "type": "number"
      -              },
      -              {
      -                "const": 3,
      -                "type": "number"
      -              }
      -            ]
      -          },
      -          "text": {
      -            "type": "string"
      -          },
      -          "type": {
      -            "enum": [
      -              "heading",
      -              "subheading",
      -              "paragraph",
      -              "quote",
      -              "bulletList",
      -              "numberedList",
      -              "sectionBreak"
      -            ],
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "type"
      -        ],
      -        "type": "object"
      -      },
      -      "op": {
      -        "const": "insert_after",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "op",
      -      "block"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "blockId": {
      -        "maxLength": 64,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "op": {
      -        "const": "delete_block",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "op",
      -      "blockId"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "afterBlockId": {
      -        "description": "omit to move the block to the very start of the ebook",
      -        "maxLength": 64,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "blockId": {
      -        "maxLength": 64,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "op": {
      -        "const": "move_after",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "op",
      -      "blockId"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "blockId": {
      +        "description": "a block id from get_ebook, or \"ref:<name>\" for a block an earlier operation in this call named",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "op": {
      +        "const": "set_text",
      +        "type": "string"
      +      },
      +      "text": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "blockId",
      +      "text"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "blockId": {
      +        "description": "a block id from get_ebook, or \"ref:<name>\" for a block an earlier operation in this call named",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "items": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "maxItems": 200,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "op": {
      +        "const": "set_items",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "blockId",
      +      "items"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "blockId": {
      +        "description": "a block id from get_ebook, or \"ref:<name>\" for a block an earlier operation in this call named",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "level": {
      +        "anyOf": [
      +          {
      +            "const": 1,
      +            "type": "number"
      +          },
      +          {
      +            "const": 2,
      +            "type": "number"
      +          },
      +          {
      +            "const": 3,
      +            "type": "number"
      +          }
      +        ]
      +      },
      +      "op": {
      +        "const": "set_heading_level",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "blockId",
      +      "level"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "afterBlockId": {
      +        "description": "omit to insert at the very start of the ebook; may be \"ref:<name>\"; after an image means after its caption",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "block": {
      +        "properties": {
      +          "href": {
      +            "description": "required for type button: the web address it links to (http or https; a bare domain is read as https). Any other scheme is refused.",
      +            "maxLength": 500,
      +            "type": "string"
      +          },
      +          "items": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "maxItems": 200,
      +            "type": "array"
      +          },
      +          "level": {
      +            "anyOf": [
      +              {
      +                "const": 1,
      +                "type": "number"
      +              },
      +              {
      +                "const": 2,
      +                "type": "number"
      +              },
      +              {
      +                "const": 3,
      +                "type": "number"
      +              }
      +            ]
      +          },
      +          "table": {
      +            "description": "required for type table",
      +            "properties": {
      +              "align": {
      +                "description": "per column; null or omitted means left",
      +                "items": {
      +                  "anyOf": [
      +                    {
      +                      "enum": [
      +                        "left",
      +                        "center",
      +                        "right"
      +                      ],
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ]
      +                },
      +                "maxItems": 10,
      +                "type": "array"
      +              },
      +              "headers": {
      +                "items": {
      +                  "maxLength": 300,
      +                  "type": "string"
      +                },
      +                "maxItems": 10,
      +                "minItems": 1,
      +                "type": "array"
      +              },
      +              "rows": {
      +                "description": "one array of cells per row, one cell per header; a short row is padded with empty cells",
      +                "items": {
      +                  "items": {
      +                    "maxLength": 300,
      +                    "type": "string"
      +                  },
      +                  "maxItems": 10,
      +                  "type": "array"
      +                },
      +                "maxItems": 100,
      +                "type": "array"
      +              }
      +            },
      +            "required": [
      +              "headers",
      +              "rows"
      +            ],
      +            "type": "object"
      +          },
      +          "text": {
      +            "description": "the block's text; for a button, its label (at most 40 characters)",
      +            "type": "string"
      +          },
      +          "type": {
      +            "enum": [
      +              "heading",
      +              "subheading",
      +              "paragraph",
      +              "quote",
      +              "bulletList",
      +              "numberedList",
      +              "sectionBreak",
      +              "table",
      +              "button"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type"
      +        ],
      +        "type": "object"
      +      },
      +      "op": {
      +        "const": "insert_after",
      +        "type": "string"
      +      },
      +      "ref": {
      +        "description": "optional name for the new block, so later operations in this call can address it as \"ref:<name>\". The result's refs map each name to the block's real id.",
      +        "pattern": "^[A-Za-z0-9_-]{1,40}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "block"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "blockId": {
      +        "description": "deleting an image also deletes its caption",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "op": {
      +        "const": "delete_block",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "blockId"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "afterBlockId": {
      +        "description": "omit to move the block to the very start of the ebook; after an image means after its caption",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "blockId": {
      +        "description": "an image moves together with its caption; a caption cannot be moved apart from its image",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "op": {
      +        "const": "move_after",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "blockId"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "blockId": {
      +        "description": "a block id from get_ebook, or \"ref:<name>\" for a block an earlier operation in this call named",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "op": {
      +        "const": "set_table",
      +        "type": "string"
      +      },
      +      "table": {
      +        "description": "at most 10 columns and 100 rows, each cell at most 300 characters of plain text or inline markdown",
      +        "properties": {
      +          "align": {
      +            "description": "per column; null or omitted means left",
      +            "items": {
      +              "anyOf": [
      +                {
      +                  "enum": [
      +                    "left",
      +                    "center",
      +                    "right"
      +                  ],
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "maxItems": 10,
      +            "type": "array"
      +          },
      +          "headers": {
      +            "items": {
      +              "maxLength": 300,
      +              "type": "string"
      +            },
      +            "maxItems": 10,
      +            "minItems": 1,
      +            "type": "array"
      +          },
      +          "rows": {
      +            "description": "one array of cells per row, one cell per header; a short row is padded with empty cells",
      +            "items": {
      +              "items": {
      +                "maxLength": 300,
      +                "type": "string"
      +              },
      +              "maxItems": 10,
      +              "type": "array"
      +            },
      +            "maxItems": 100,
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "headers",
      +          "rows"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "blockId",
      +      "table"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "blockId": {
      +        "description": "a block id from get_ebook, or \"ref:<name>\" for a block an earlier operation in this call named",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "op": {
      +        "const": "convert_block",
      +        "type": "string"
      +      },
      +      "type": {
      +        "description": "paragraph, heading, subheading and quote blocks convert into one another; any automatic treatment is removed",
      +        "enum": [
      +          "paragraph",
      +          "heading",
      +          "subheading",
      +          "quote"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "blockId",
      +      "type"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "blockId": {
      +        "description": "the block to copy to directly after itself; title, image and caption blocks cannot be copied",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "op": {
      +        "const": "duplicate_block",
      +        "type": "string"
      +      },
      +      "ref": {
      +        "description": "optional name for the new block, so later operations in this call can address it as \"ref:<name>\". The result's refs map each name to the block's real id.",
      +        "pattern": "^[A-Za-z0-9_-]{1,40}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "blockId"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "align": {
      +        "enum": [
      +          "left",
      +          "center",
      +          "right"
      +        ],
      +        "type": "string"
      +      },
      +      "alt": {
      +        "description": "\"\" removes the alt text",
      +        "maxLength": 300,
      +        "type": "string"
      +      },
      +      "blockId": {
      +        "description": "a block id from get_ebook, or \"ref:<name>\" for a block an earlier operation in this call named",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "caption": {
      +        "anyOf": [
      +          {
      +            "maxLength": 200,
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "text creates or rewrites the caption block under the image; null removes it"
      +      },
      +      "op": {
      +        "const": "set_image",
      +        "type": "string"
      +      },
      +      "sizePreset": {
      +        "description": "auto lets Unplain shrink it to avoid a half-empty page; the others are fixed widths",
      +        "enum": [
      +          "auto",
      +          "small",
      +          "medium",
      +          "large",
      +          "full"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "blockId"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "blockId": {
      +        "description": "limit the replacement to this block; omit to replace across the whole ebook",
      +        "maxLength": 64,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "find": {
      +        "description": "exact, case-sensitive text to replace everywhere it occurs in block text, list items, button labels and table cells; the whole call fails if it occurs nowhere",
      +        "maxLength": 1000,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "op": {
      +        "const": "replace_text",
      +        "type": "string"
      +      },
      +      "replace": {
      +        "maxLength": 20000,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "find",
      +      "replace"
      +    ],
      +    "type": "object"
      +  }
      +]
  4. Changed2 schema fields changed
    • changedInput schema / properties / cta / properties / showButton / description
      Previous value: -"Whether the CTA page draws its button (true when never set). false hides it and keeps buttonText and url, so true brings the same button back. The button draws only when this is true and buttonText is not empty; give it a url too, or it links nowhere."New value: +"Whether the CTA page draws its button (true when never set). false hides it and keeps buttonText and url, so true brings the same button back. The button draws only when this is true and buttonText is not empty, and it is in the PDF only with a real url."
    • changedInput schema / properties / cta / properties / url / description
      Previous value: -"Where the button goes: a web address (a bare domain is read as https) or an email address (opened as mailto:). Any other scheme is refused. An empty string leaves the button with no link; to have no button, set showButton to false instead."New value: +"Where the button goes: a web address (a bare domain is read as https) or an email address (opened as mailto:). Any other scheme is refused. A new ebook has none. A shown button with no url, or the placeholder \"https://example.com\", is left out of the PDF and the call warns; to have no button, set showButton to false instead."
  5. Changed4 schema fields changed
    • changedInput schema / properties / cta / description
      Previous value: -"The CTA page Unplain adds at the end of the ebook: its layout, headline, body, button, the address the button opens, the social links and the footer credit switch. Unplain writes this page, so it takes no part of the document and never counts toward the free plan's page limit. Send only what should change; every key left out stays as it is."New value: +"The CTA page Unplain adds at the end of the ebook: its layout, headline, body, button (and whether it is shown), the address the button opens, the social links and the footer credit switch. Unplain writes this page, so it takes no part of the document and never counts toward the free plan's page limit. Send only what should change; every key left out stays as it is."
    • changedInput schema / properties / cta / properties / buttonText / description
      Previous value: -"The button's label, for example \"Book a call\". An empty string hides the button."New value: +"The button's label, for example \"Book a call\". An empty string hides the button (no default label is drawn in its place)."
    • addedInput schema / properties / cta / properties / showButton
      Added value: +{
      +  "description": "Whether the CTA page draws its button (true when never set). false hides it and keeps buttonText and url, so true brings the same button back. The button draws only when this is true and buttonText is not empty; give it a url too, or it links nowhere.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / cta / properties / url / description
      Previous value: -"Where the button goes: a web address (a bare domain is read as https) or an email address (opened as mailto:). Any other scheme is refused. An empty string leaves the button with no link."New value: +"Where the button goes: a web address (a bare domain is read as https) or an email address (opened as mailto:). Any other scheme is refused. An empty string leaves the button with no link; to have no button, set showButton to false instead."
  6. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources