List a site's sections
list_sectionsLists a site's top-level sections in order - each one's CURRENT index, its stable section_id, its kind, its heading, and its fields (every editable node inside it: heading, body, items[n].title, ... with each node's index and current text) - so you can aim edit_section at exactly the right node with section_id + field. Indices shift whenever an earlier section is removed, so list the sections again after any removal instead of reusing an index you recorded earlier. section_count here is the number of top-level sections listed (the same number as listed_section_count in add_section / edit_section results; their section_count counts every node in the tree). 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": "list_sections"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. | |
| site_key | No | The site to list. 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. |