Add a section
add_sectionAdds ONE section of any kind (menu, map, faq, hours, ...) to an existing site, styled like the rest of it, without rebuilding the site. Pass content_json with that section's keys (or html with your own markup instead of kind), and position to choose where it goes (default: end, before the footer). Saves an undo version first; stage:true previews it before it goes live. Free. In the result, section_count is the number of nodes in the page tree (nested ones included), NOT the number of sections; listed_section_count is the number of top-level sections and matches what list_sections returns.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "add_section"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | Instead of kind: your own markup for the new section(s), e.g. "<section>...</section>" with its own <style>. Imported like create_site_from_html (the result includes its import report). Best for sites built from HTML. Give kind or html, not both. | |
| kind | No | The kind of section to add: hero, about, services, features, gallery, testimonials, pricing, faq, hours, contact, cta, footer, menu, map, social, header, products, reviews. | |
| page | No | Which page of the site, as its path ("/about", "/contact"). Omit for the home page. See list_pages. | |
| stage | No | true = work on a staged copy instead of the live site: preview it at staged_preview_url, then publish_staged or discard_staged. Omit for a normal (immediately live) edit. | |
| colors | No | Optional, for kind "map" only. Colours for the new map as 6-digit hex like #1a1a1a: background, text, accent (the link). Leave out to match the section next to it on an imported page. | |
| position | No | 0-based slot among the top-level sections (indexes as in list_sections order). Omit to add at the end, just before the footer if there is one. | |
| site_key | No | The site to add to. Defaults to the caller's current draft site when omitted. | |
| draft_token | No | The draft token returned by draft_create, if you are working on an anonymous draft. Only needed when your client cannot send the x-pagetool-draft-token header. | |
| content_json | No | This section's content, as a JSON string or an object, with the same keys as create_site_from_brief's content_json uses for this kind (e.g. menu: {"heading": "Menu", "items": [{"title": "Latte", "price": "$4", "group": "Drinks"}]}). contact also takes "email", "phone" and "address" (email renders as a mailto link); header and footer take "business_name" for the brand. Omit for honest [add your ...] placeholders. Ignored keys are reported in warnings. |