Skip to main content
Glama

swebsy_edit_section

Update an existing webpage component by supplying a full replacement tree, complete HTML, or a small JSON patch; keep existing IDs so attached styles remain intact.

Instructions

Modify an existing component. By default this edits the selected component. To edit a component identified by read_page, provide its targetPath; an explicit path overrides the canvas selection. Preferred: provide component — the full replacement component tree (compact DSL OK), best for structural changes. Alternative: provide html — the complete modified HTML string. Fallback: provide patch — JSON Patch (RFC 6902) for tiny single-property tweaks. Supply exactly one. Preserve existing IDs: an id kept in the edit keeps the styles attached to it; an id you drop loses them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
htmlNoThe complete modified HTML for the target component. Prefer existing semantic/theme classes over raw Tailwind utilities. Preserve existing id attributes.
patchNoJSON Patch (RFC 6902) operations applied to the target component JSON. Only for tiny single-property tweaks.
summaryYes1 sentence explaining what the edit does.
componentNoFull replacement component tree. Use compact DSL (t/c/x/a/k) to save tokens. Preserve existing attributes.id values. A `style` object merges into the styles already on that id, so you only send the declarations that change.
targetPathNoZero-based component indexes from the current page root, exactly as returned by the most recent `read_page` call (for example [0] for the first top-level section or [0, 2] for its third child). Use this when the user names or relatively identifies a component instead of selecting it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.0

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the critical behavioral consequence of editing: 'Preserve existing IDs: an id kept in the edit keeps the styles attached to it; an id you drop loses them.' It also reveals that a `style` object merges into existing styles rather than replacing them. It doesn't mention whether the operation is reversible or whether it persists immediately, but the ID/style-loss warning is a significant behavioral disclosure.

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?

The description is dense but well-structured: it front-loads the core action, then orders the three strategies by preference, then ends with the critical ID-preservation warning. Every sentence carries information. It is longer than ideal, but the complexity of the tool (three mutually exclusive input modes plus target selection) justifies the length.

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 a complex mutation tool with no annotations and no output schema, the description covers the key decision points: which input to use, how to target a component, and what behavioral consequences to expect. It doesn't describe the return value or error cases, but the schema already documents all parameters thoroughly, and the description's guidance on selection vs targetPath is complete enough for an agent to invoke the tool correctly.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds value beyond the schema by explaining the relationship between the three mutually exclusive edit modes (component vs html vs patch), the merge semantics of `style`, and the meaning of `targetPath` relative to `read_page` output. The compact DSL aliases (t/c/x/a/k) are also explained in the schema, but the description's 'exactly one' constraint and preference ordering add real semantic guidance.

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 opens with a specific verb and resource ('Modify an existing component') and immediately distinguishes the default target (canvas selection) from the `targetPath` alternative. It also names three distinct edit strategies (component, html, patch) with clear guidance on when each is preferred, which separates it from siblings like swebsy_add_section and swebsy_delete_section.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use each input mode: 'Preferred: provide component... Alternative: provide html... Fallback: provide patch... Supply exactly one.' It also explains when to use targetPath ('when the user names or relatively identifies a component instead of selecting it'). This is explicit routing guidance with no ambiguity.

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