sTool = "page")A page in TypeStack is composed of several pieces:
cms_structure).cms_structure_translations).cms_substances).cms_pages).cms_page_grid) that selects slides.cms_content) positioned inside those slides. This example creates a new page under structure_id = 7 (for example the homepage), using template 1, and writes an initial HTML block into the first slide of that template:
{ "aOperations": [ { "sTool": "page", "sMode": "create-page", "aArgs": { "sTitle": "TypeStack Magic – Agent documentation", "sSubtitle": "How the Agent reads, writes and builds pages", "sDescription": "Internal documentation page generated by the Agent.", "sCase": "typestack-magic-agent-docs", "iParentStructureID": 7, "iTemplateID": 1, "sContentHTML": "TypeStack Magic
\nThis page was created by AgentToolPage.
" } } ]
} Internally, the Agent will:
cms_structure row under iParentStructureID.structure_parent_id is never 0 for children; the root is typically 1. The structure_substance_id is resolved from the current session. cms_structure_translations row for the current language, with: translation_title = sTitletranslation_case = sCase (URL slug)translation_subtitle, translation_description as providedcms_pages row for the current substance: page_structure_id = new structure IDpage_template_id = iTemplateIDpage_status_id = 1 (active)cms_template_grid into cms_page_grid: grid_template_id = iTemplateID, ordered by grid_order, grid_id.cms_page_grid entry for that grid_slide_id.cms_content row for that slide (optional, only if sContentHTML is provided): content_page_id = new page IDcontent_slide_id = selected slidecontent_structure_id = new structure IDcontent_html = sContentHTMLcontent_language_id = current language Positioning fields such as content_position_x, content_position_y, content_size_x, content_size_y, content_order control where the content lives inside the slide grid. The helper inserts a minimal block; more advanced layouts can be added later.
The JSON response includes the new iStructureID, iPageID, iContentID and a detailed aDebug trail that logs every step.
In the current step, sMode = "create-page" focuses on simple page creation. Read/update/delete modes will be added on top of the same AgentToolPage class.