replace_section_in_page
Replace a single section in a webpage to iteratively improve its design. The tool updates only the targeted section while preserving all others, ensuring visual consistency across the page.
Instructions
Replace a single section in an existing page with an improved version.
This tool enables iterative design improvement by replacing only the specified section while preserving all other sections. The new section maintains visual consistency with the rest of the page.
CRITICAL: The page HTML must use section markers in this format:
Args: page_html: Full HTML of the existing page with section markers. section_type: Section to replace. Valid types: - navbar: Navigation bars, headers - hero: Hero sections, landing areas - stats: Statistics, metrics sections - features: Feature grids, benefit lists - testimonials: Customer reviews, social proof - pricing: Pricing tables, plans - cta: Call-to-action sections - footer: Site footers modifications: Detailed description of desired changes. Example: "Add mega menu, search bar, and announcement banner" preserve_design_tokens: Keep colors/typography consistent with page (default: True) theme: Visual style preset for the new section content_language: Language code for content (default: "tr")
Returns: Dict containing: - html: Updated full page HTML with only the target section changed - modified_section: Which section was replaced - preserved_sections: List of sections that were NOT modified - design_notes: Explanation of design decisions - error: Error message if the operation failed
Example: # Update only the navbar in an existing landing page result = replace_section_in_page( page_html=existing_page, section_type="navbar", modifications="Add mega menu with 4 columns, search bar, dark mode toggle" )
# The result contains the complete updated page
updated_page = result["html"]
# Hero, Features, Pricing, Footer etc. are unchanged
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| theme | No | modern-minimal | |
| page_html | Yes | ||
| section_type | Yes | ||
| use_trifecta | No | ||
| modifications | Yes | ||
| content_language | No | tr | |
| preserve_design_tokens | No |