Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
themeNomodern-minimal
page_htmlYes
section_typeYes
use_trifectaNo
modificationsYes
content_languageNotr
preserve_design_tokensNo
Behavior4/5

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

No annotations provided, so description carries full burden. It explains that only the target section is replaced, others preserved, and that visual consistency is maintained. Also describes return format and error handling.

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

Conciseness5/5

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

Well-structured with clear sections: intro, critical note, args, returns, example. Each sentence adds value, and the length is appropriate for the tool's complexity.

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

Completeness5/5

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

Given 7 parameters (3 required), no output schema, and no annotations, the description covers input requirements, behavior, return format, and provides an example. It is very complete for the tool's purpose.

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

Parameters5/5

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

Schema coverage is 0% (no parameter descriptions in schema). The description adds detailed explanations for each parameter, including valid section types, examples for modifications, default values for preserve_design_tokens and content_language, and even describes the return value structure.

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 description clearly states it replaces a single section in an existing page with an improved version, distinguishing it from sibling tools like design_section or refine_frontend by specifying it works on existing page HTML with section markers.

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?

Provides critical usage notes (section marker format), valid section types, and an example. It implies iterative design improvement but could explicitly state when not to use this tool versus alternatives like design_page or compile_project_drafts.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/archolet/claude-gemini-bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server