Skip to main content
Glama

Heal locator

heal_locator

Find the likely intended element when a locator no longer matches or matches several, then suggest a verified replacement with a confidence score and reasons; review before updating tests.

Instructions

For a locator that no longer matches (or matches several elements), find the most likely intended element on the current page and suggest a verified replacement with a confidence score and reasons. Accepts the same session as explore_page. Never edits files: review the suggestion, update the test, then re-run.

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": {
      "url": "<url>",
      "locator": "<locator>"
    },
    "name": "heal_locator"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYes
deviceNoEmulate a device for mobile web: a Playwright device name such as "iPhone 15" or "Pixel 7" (list_devices), or "desktop" (default)
locatorYes
sessionNoReach pages behind a login or several steps into a flow
check_devicesNoAlso verify the suggestion on these devices, e.g. ["desktop", "iPhone 15"], so a mobile fix does not break desktop

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.3.0
    • addedInput schema / properties / check_devices
      Added value: +{
      +  "description": "Also verify the suggestion on these devices, e.g. [\"desktop\", \"iPhone 15\"], so a mobile fix does not break desktop",
      +  "items": {
      +    "type": "string"
      +  },
      +  "maxItems": 8,
      +  "type": "array"
      +}
    • addedInput schema / properties / device
      Added value: +{
      +  "description": "Emulate a device for mobile web: a Playwright device name such as \"iPhone 15\" or \"Pixel 7\" (list_devices), or \"desktop\" (default)",
      +  "type": "string"
      +}
  2. First observedv0.2.1

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 carries the full burden, and it does disclose two useful traits: results come back with a confidence score and reasons, and the tool never writes files. However, it omits side-effect behavior — the tool loads a URL and can execute session steps (click, fill) that mutate page state — and it never states whether the operation is otherwise read-only or what happens when no candidate is found.

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?

Two sentences, both load-bearing: the first states purpose and output shape, the second states the workflow constraint and the no-file-edit guarantee. Nothing is repeated from the name or schema, and the critical constraint is front-loaded in the second sentence.

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 5-parameter tool with a nested session object and no output schema, the description covers the return shape (replacement suggestion, confidence, reasons) and the safety posture (no file edits, human review loop). Gaps remain around failure behavior and the fact that session steps perform real interactions, but nothing essential to invoking it correctly is missing.

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 60%, so baseline is 3. The description adds real meaning for the session parameter ('Accepts the same session as explore_page') and explains that healing happens against the page reached by url. The unexplained remainder — notably url and check_devices semantics relative to the primary suggestion — is handled partly in the schema, so no bonus is earned.

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

Purpose4/5

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

The description uses a specific verb+resource pairing: given a broken or ambiguous locator, find the likely intended element and suggest a verified replacement with confidence and reasons. It also names the triggering conditions (no longer matches, matches several elements), which is precise. It stops short of differentiating itself from the obvious sibling check_locator, mentioning explore_page only for session compatibility.

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?

It clearly states the situation that calls for this tool (a failing or ambiguous locator) and gives an explicit post-call workflow: review the suggestion, update the test, then re-run. That is strong context plus an explicit exclusion ('Never edits files'). It does not say when to reach for check_locator or explore_page instead, but per the rules missing sibling names are not penalized.

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