Skip to main content
Glama

Sugerir correção de seletor (Self-healing)

suggest_selector_fix

Suggests alternative selectors when UI changes break tests. Uses LLM to recommend resilient options prioritizing data-testid, role, and accessible text.

Instructions

Quando um teste falha por elemento não encontrado (seletor quebrado após mudança de UI), usa LLM para sugerir seletor alternativo mais resiliente. Prioriza data-testid, role, texto acessível.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameworkNoFramework do teste. Detectado automaticamente se omitido.
errorOutputNoOutput do terminal da falha. Se vazio, lê de .qa-lab-last-failure.log.
testFilePathYesCaminho do arquivo de teste que falhou (ex: specs/login.spec.js).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorNo
explicacaoNo
codigoCorrigidoNo
selectorSugeridoNo
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It reveals that an LLM is used and the selector prioritization strategy, which is useful. But it does not state whether the tool modifies files, requires network access, or has side effects; the non-destructive nature is only implied by 'sugerir' (suggest).

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?

The description is a single sentence that is front-loaded with the primary purpose and includes the key heuristic (priority order). No redundant phrases or unnecessary details, making it highly concise.

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?

The tool has an output schema (per context signals) and schema descriptions cover all parameters, so return values and parameter meaning are documented. The description adds trigger condition and priority heuristic. It misses alternative tool mentions and explicit safety behavior, but overall it is fairly complete for a focused suggestion tool.

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 schema provides 100% coverage with each parameter having a description, so the baseline is 3. The tool description adds no additional parameter-specific details beyond the schema, and it does not explain how parameters like 'framework' or 'errorOutput' influence the suggestion logic beyond what schema already says.

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 clearly states the tool's purpose: when a test fails due to a broken selector, it uses an LLM to suggest a more resilient alternative. It specifies the context (element not found after UI change) and the priority order (data-testid, role, accessible text), which distinguishes it from siblings like 'suggest_fix' or 'analyze_failures'.

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?

The trigger condition is explicit ('Quando um teste falha por elemento não encontrado'), giving clear guidance on when to use this tool. However, it does not mention situations when it should not be used or compare itself to alternatives like 'suggest_fix', leaving some ambiguity.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Wesley-Gomes93/qa-lab-agent-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server