Skip to main content
Glama

Pagetool

Add a section

add_section

Adds 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

NameRequiredDescriptionDefault
htmlNoInstead 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.
kindNoThe kind of section to add: hero, about, services, features, gallery, testimonials, pricing, faq, hours, contact, cta, footer, menu, map, social, header, products, reviews.
pageNoWhich page of the site, as its path ("/about", "/contact"). Omit for the home page. See list_pages.
stageNotrue = 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.
colorsNoOptional, 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.
positionNo0-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_keyNoThe site to add to. Defaults to the caller's current draft site when omitted.
draft_tokenNoThe 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_jsonNoThis 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds real behavior beyond the annotations: an undo version is saved first, stage:true routes to a staged copy rather than the live site, and the operation is free. The result-field clarification (section_count counts page-tree nodes, not sections) resolves a likely misread. It does not state failure conditions, such as an invalid position index or a missing site.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action is front-loaded in the first clause, and the parenthetical kind examples aid scanning. Dense but mostly purposeful; the closing sentence on section_count vs listed_section_count is long, though justified since there is no output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter tool with nested objects and no output schema, the description covers staging, undo, defaults, the kind/html trade-off, and the meaning of the key result fields. Gaps remain around error behavior and what happens when the page or site does not exist, but the agent has enough to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is already 100%, so the schema carries the parameter documentation, including the kind enum and per-kind content keys. The description reinforces two points (position defaults to the end before the footer; kind vs html are alternatives) but adds little beyond the structured fields. Baseline 3 is correct here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Adds ONE section of any kind ... to an existing site') and immediately bounds the scope: it adds a single section and does not rebuild the site. Listing kinds and the one-vs-many emphasis lets an agent separate it from site-creation and section-editing siblings without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear context: use when adding a section to an existing site without rebuilding, with stage:true as the preview path. It also names the in-tool choice between content_json (structured) and html (custom markup). It stops short of explicitly excluding edit_section for changes to already-existing sections, so routing to that sibling is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources