Skip to main content
Glama

Edit HTML

edit_html
Destructive

Write HTML + Tailwind into a frame or element.

  • replace_content (default): replace the target's children. Elements carrying an existing data-id are updated in place; elements without one reuse the existing element at the same place with the same tag; the rest is created; children not present anymore are deleted. A written back without data-items keeps its rows. Other data-id values are your own keys (data-id="save"): the result gives the id each one got.

  • append / prepend: add inside the target.

  • insert_before / insert_after: add next to the target element.

  • replace: replace the target element itself. Keep its data-id on the new element to keep its id, comments and selection (even with another tag).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "fileId": "<fileId>",
      "targetId": "<targetId>",
      "html": "<html>"
    },
    "name": "edit_html"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataNoValues for <template data-each> and {{field}} placeholders in the html.
htmlYes
modeNoreplace_content
fileIdYes
targetIdYesFrame or element id (data-id).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, and the description goes well beyond that by specifying exactly what is destroyed: in replace_content, "children not present anymore are deleted," while data-id-carrying elements are updated in place and id-less ones are reused at the same position. It also discloses id-assignment behavior and that template data-each rows survive a write-back without data-items, plus how to preserve id/comments/selection across a replace.

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?

Front-loaded verb+resource sentence followed by one bullet per mode is a clean structure with almost no filler. The replace_content bullet is a long run-on that packs deletion, in-place update, reuse, and template exceptions into one sentence, which costs some readability.

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 destructive, five-parameter mutation tool with no output schema, the description covers the risky parts well: what gets deleted, how ids are preserved, and that the result returns the ids assigned to custom data-id keys. The unexplained `fileId` and the lack of any note on failure conditions are the remaining gaps.

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 coverage is only 40%, so the description must compensate, and it does for the most important fields: all six `mode` enum values are explained with their placement semantics, and `data` is tied to <template data-each> and {{field}} placeholders. `fileId` is never mentioned and `html` only implicitly, leaving one real gap.

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 opening line states a precise verb and resource ("Write HTML + Tailwind into a frame or element") and the bullet list immediately disambiguates the six distinct write operations. An agent can tell this is the mutation counterpart to a read tool like get_html without inspecting the schema.

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?

Each mode bullet explains the context that selects it (replace_content for children, insert_before/after for adjacent placement, replace for the element itself), which is effectively per-mode when-to-use guidance. It stops short of naming an alternative tool or stating when not to use it (e.g., prefer a read tool to inspect first).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.