Skip to main content
Glama

Pagetool

Edit or remove a site section

edit_section
Idempotent

Changes one node of a site - text, title, styling, link, image, heading level - or removes it and its descendants when remove is true. Address a section with section_id (from list_sections) or index, then aim at the node inside it with field (e.g. "heading", "body", "items[1].title"); list_sections shows every section's fields. Text goes on text nodes only: content aimed at a container is refused with the right field names. Free, and no account is needed for a draft you created.

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": "edit_section"
  }
}

Input Schema

NameRequiredDescriptionDefault
altNoNew alt text for an image section.
srcNoNew image/media source (same URL scheme rules as href).
hrefNoNew link target (http:, https:, mailto:, tel:, a path starting with /, or an in-page anchor like #pricing).
pageNoWhich page of the site, as its path ("/about", "/contact"). Omit for the home page. See list_pages.
fieldNoWhich node inside the addressed section to change, from that section's fields in list_sections: "heading", "body", "text[n]", "links[n]", "image", "items[n].title", "items[n].body", "items[n].price", "items[n].link", "items[n].image". A card with no link or photo yet: set field "items[n].link" with href (and optional content as the label) or "items[n].image" with src, and it is created. "items[n]" addresses the whole card (use with remove: true to delete one card). Omit to change the addressed node itself.
indexNoThe section (or node) index to edit or remove. Indices SHIFT/renumber whenever an earlier section is removed elsewhere on the page, so an index recorded before a removal may now point at a different section. Prefer section_id; call list_sections first (or after any removal) to get each section's CURRENT index and its stable section_id, which never changes. Give index, section_id, or both (they must agree).
levelNoNew heading level (1-6) when this section is a heading textBox.
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.
titleNoNew title attribute for this section.
removeNoWhen true, removes this section and its descendants instead of editing it (with field "items[n]": removes that one card).
contentNoNew text content for this section.
html_idNoNew HTML id for the node (e.g. "contact" for #contact anchor links).
subtypeNoNew subtype for this section.
add_itemNoAdds one card to the addressed section (services, features, pricing, products, testimonials...), styled like its last card. Fields not given are left out. The response gives its item number.
site_keyNoThe site to edit. Defaults to the caller's current draft site when omitted.
class_nameNoNew Tailwind class string for this section.
section_idNoThe stable id of the section to address, exactly as list_sections returns it (e.g. "about-1"). It survives removals, unlike index. This ADDRESSES a section; it does not rename anything (use html_id for that).
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.

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?

Beyond the annotations it discloses non-obvious behavior: text edits are refused on containers with corrective field names, and edits are free with no account required for a self-created draft. It does not state whether a removal is recoverable, which matters given destructiveHint:false alongside a delete path — a tension the agent would have to resolve on its own.

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?

Three dense sentences, front-loaded with the action and its scope, then addressing, then node-type constraints and cost. Information-dense with no filler, though the middle sentence packs several concepts that could be split for scanability.

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 an 18-parameter mutation tool with nested objects and no output schema, the description covers the hard parts: dual addressing (section_id vs shifting index), field paths into nested cards, container-vs-text validation, and staging. Draft-token and add_item response details are left entirely to the schema, which handles them adequately.

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 100%, so the schema already carries the meaning of field, section_id, index, remove and stage. The description largely restates those semantics (field node paths, index renumbering, section_id stability) rather than adding new constraints, so baseline 3 applies.

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?

The opening sentence gives a specific verb (changes/removes) plus the exact resource (one node of a site section) and enumerates the editable facets (text, title, styling, link, image, heading level). It is clearly distinguished from list_sections and add_section by naming list_sections as the source of addressing data and by covering removal.

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?

It tells the agent to get section_id from list_sections, when to prefer section_id over index, when to set remove:true, and how stage changes the workflow (preview then publish_staged or discard_staged). It stops short of explicit when-not-to-use guidance versus add_section for creating nodes, but the usage context is concrete.

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