Skip to main content
Glama

heal_selector

Fix a CSS selector that no longer matches by inspecting the live page and returning up to three ranked, resilient Playwright locators with reasons.

Instructions

Fix a CSS selector that stopped matching. Looks at what is actually on the page right now and suggests up to 3 resilient Playwright locators (role/label/text first, CSS last), ranked with reasons.

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": {
      "selector": "<selector>"
    },
    "name": "heal_selector"
  }
}

Input Schema

NameRequiredDescriptionDefault
selectorYesThe broken CSS selector, e.g. #submit-btn-old

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral burden; it does say the tool inspects live page state and returns suggestions rather than applying them. But the leading verb "Fix" is ambiguous about whether anything is mutated, and the requirement that a page be navigated/loaded before calling is not disclosed. Ordering policy (role/label/text before CSS) is a genuine plus.

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?

One tightly packed sentence, front-loaded with the purpose, then scope and ranking rationale. Nothing is redundant or wasted.

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 single-parameter repair tool with no output schema, the description adequately conveys the return shape (up to 3 ranked locators with reasons) and ranking heuristic. The missing piece is the precondition that a live page must be loaded for it to inspect.

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?

The single parameter is fully described in the schema, including a concrete example, so the schema already does the work. The description only implies the parameter is the broken selector, adding no format or validation guidance beyond that.

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?

States a specific verb and resource ("Fix a CSS selector that stopped matching") plus the exact output shape: up to 3 ranked Playwright locators with reasons. This clearly separates it from siblings like browser_click, browser_evaluate, or run_playwright_test, which act on or run pages rather than repair selectors.

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

Usage Guidelines3/5

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

The trigger condition is implied by "stopped matching," so an agent knows this is a recovery tool for failed selectors. However, it never states prerequisites (an active/loaded page, whether a snapshot is needed first) or when to prefer browser_snapshot/browser_evaluate or rerunning the test instead.

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