Royal MCP’s Divi Tools — Reference
Nine free tools that let Claude, ChatGPT, or Perplexity edit Divi pages safely — on both Divi 4 (shortcode format) and Divi 5 (block format). Format detection, layout validation, format-aware find-and-replace, page cloning with fresh clientIds, and Library-entry application. Every destructive write emits a 72-hour undo token.
How Divi + Royal MCP works
When Divi is active on your site — either the Divi Builder plugin or the Divi theme — Royal MCP registers nine additional MCP tools for AI-driven Divi editing. Tools appear automatically the moment Divi is detected; no configuration required.
Divi’s data model is unlike Elementor’s. Divi 4 stores pages as nested shortcodes with their own quote-parsing quirks. Divi 5 stores them as blocks with clientId references that must stay unique. Both formats have footguns that break naive find-and-replace — a missing close-tag, a dropped dynamic-content token, a collision on cloned clientIds. Every Divi write tool in Royal MCP validates layout structure before saving. If the write would break the layout, the tool refuses it and returns the specific error, so an AI agent can retry or bail cleanly.
Every clone, replace, and import operation returns an undo token valid for 72 hours. Ask your AI client to undo the last operation and it’ll roll the write back cleanly without touching anything else on the page.
The nine free Divi tools
divi_get_page_format
Detect whether a page uses Divi 4 shortcode format or Divi 5 block format.
AI agents route to the right editing pattern automatically. Use this as the first step of any multi-step Divi workflow so downstream tool calls know which format they’re working with.
divi_get_page_outline
Extract the section, row, column, and module structure of any Divi page.
The read-only companion to every Divi editing workflow. Ask Claude for the outline before planning a rebuild or audit — the response is compact enough to fit in a normal chat context, and includes module IDs so subsequent write operations can target specific elements.
divi_validate_layout
Pre-write validator: checks matched open/close pairs, whitelisted module names, preserved dynamic-content tokens.
Refuses writes that would corrupt the layout. Every other Divi write tool calls this internally, but it’s also exposed directly so an AI agent can validate a hand-crafted layout string (from clipboard, from a snippet library, from a paste job) before pushing it.
divi_list_local_templates
Enumerate saved layouts in the Divi Library.
Returns ID, name, type, and creation date for every entry. Use this to let an AI agent pick a template by name (“apply the City Services layout to the Portland page”) instead of forcing the user to look up IDs.
divi_library_get
Read a specific saved layout from the Divi Library by ID.
For inspection or reuse. Pair with divi_import_template to copy a Library entry’s structure into a target page.
divi_replace_text
Format-aware find-and-replace across all modules on a Divi page.
Dry-run preview and active-editor-session detection built in. Safe for both Divi 4 and Divi 5 pages. If someone has the page open in the builder at the moment of the write, the tool refuses so it doesn’t stomp on unsaved edits.
divi_clone_page
Duplicate any Divi 4 or Divi 5 page as a fresh draft.
Preserves builder meta and regenerates Divi 5 clientIds so the duplicate opens in the editor without ID collisions. 72-hour undo token included. Common pattern: clone a services page, then use divi_replace_text and divi_replace_image to retarget it for a new offering.
divi_replace_image
Swap an image URL across every image-bearing Divi element on a page.
Dual-format aware for Divi 4 shortcodes and Divi 5 blocks. Handles background images, module images, gallery items — anywhere Divi stores an image reference. 72-hour undo token included.
divi_import_template
Apply a saved Divi Library entry to a target page.
Merge mode appends to existing content; replace mode overwrites. Useful for standing up a new page from a saved template, or adding a shared section (footer CTA, testimonials block) to an existing page. 72-hour undo token included.
Example queries
Ask Claude, ChatGPT, or Perplexity questions like these once Divi + Royal MCP are connected:
- “Is my /pricing page built in Divi 4 or Divi 5, and what modules does it use?”
- “Show me the section-and-module outline of the homepage so I can plan a rebuild.”
- “Replace every ‘Buy Now’ label with ‘Get Started’ on the homepage — but preview first.”
- “Clone my New York services page as a Denver services draft.”
- “Swap the hero image on the About page from the old headshot URL to the new one.”
- “Apply my ‘City Services’ Divi Library entry to the Portland page in merge mode.”
- “List every saved layout in the Divi Library so I can pick one to reuse.”
- “Validate the layout string in my clipboard before I paste it into the About page.”
The Divi Claude Skill — teach Claude your patterns
The Divi tools are the API surface. The Divi Claude Skill is the playbook that teaches Claude how to use them well: when to clone versus author from scratch, how to plan D4→D5 migration, which patterns hold up across builder versions.
Pro Divi toolkit — agency-scale editing
The free nine tools cover single-page work — clone, edit, swap, apply. Bulk work across many pages, cross-site client work, and D4→D5 migration land in Royal MCP Pro. The Pro toolkit adds eight more Divi tools plus programmatic-authoring support:
Divi 5 — recovery for the empty-post case
Divi 5’s block format has one recovery scenario worth calling out separately, because it’s the failure mode that surprises new users of programmatic authoring. If a Divi 5 post is authored programmatically and then someone opens it in the WordPress editor or Divi builder afterward, the post body can end up empty. The recovery is straightforward but has to happen in the right order.
Permissions & safety
Divi write operations require the connecting user to have edit_posts or edit_pages capability on the relevant content. Royal MCP enforces WordPress’s standard capability checks on every Divi tool call — the AI client can only edit what the user themselves has permission to edit.
If a Divi page is open in the builder when a write is attempted, tools that mutate content will refuse rather than risk stomping on unsaved edits. Close the builder tab (or dismiss the session) before re-running the write.
Undo tokens for clones, replaces, and imports are valid for 72 hours from the operation. After that they expire — use the WordPress revision system for older rollbacks.