Skip to main content
Glama

dom.remove

Removes an element from the page by CSS selector, XPath, visible text, snapshot ref, or backend node ID, with optional frame, browser, and target context.

Instructions

Remove an element from the document.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "dom.remove"
  }
}

Input Schema

NameRequiredDescriptionDefault
nthNoZero-based index when the locator matches several elements.
refNoSnapshot ref (eNN) from page.snapshot.
textNoVisible text of the element.
xpathNoXPath expression.
frame_idNoFrame to search within; see page.list_frames.
selectorNoCSS selector; pierces shadow DOM.
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
backend_node_idNoCDP backendNodeId, e.g. from inspector.pick.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.5/5.0
Behavior2/5

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

Annotations already disclose readOnlyHint=false and openWorldHint=true, so the description only needs to add context beyond that — and it adds none. It does not state whether child nodes/subtree listeners are destroyed, whether the change is reversible, whether snapshot refs become stale after removal, or whether the page target must be attached.

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

Conciseness3/5

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

A single front-loaded sentence with zero wasted words, which is structurally good. But the brevity crosses into under-specification for a destructive nine-parameter tool, so the concision buys little practical value.

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

Completeness2/5

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

With nine parameters, zero required fields, and no output schema, the description needed to explain at minimum that some locator must be supplied and what the tool returns or throws. It omits both, so an agent calling it with no arguments has no warning about what happens.

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

Parameters3/5

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

Schema description coverage is 100% across all nine locator parameters (ref, selector, xpath, text, nth, frame_id, target_id, browser_id, backend_node_id), so the schema carries the full semantic load and baseline 3 applies. The description contributes nothing about how these locators combine or which takes precedence.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Remove an element from the document" names a specific verb and resource, so the basic action is unambiguous. However, it does not say how an element is identified (by ref, selector, xpath, text, backendNodeId) or how it differs from adjacent DOM tools such as dom.set_html or dom.set_attribute, leaving the agent to open the schema to understand scope.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no precondition (e.g. needing a fresh page.snapshot ref), and no mention of the alternative of mutating markup via dom.set_html instead. The agent must infer everything about applicability from the name alone.

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

Deploy Server

Other Tools