Skip to main content
Glama

map_locator

Convert PageSnap YAML locators into Playwright, Selenium, or Cypress snippets with score and stability.

Instructions

Map a PageSnap YAML locator {by, value} to a Playwright, Selenium, or Cypress snippet with score and stability. Sauce Demo data-test ids still emit getByTestId (configure testIdAttribute in Playwright). Never maps testid to getByRole('generic').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byYesYAML by strategy: testid, role, label, id, name, placeholder, linkText, css, xpath.
nameNoAccessible name, used with role locators.
valueYesLocator value from the YAML snapshot.
frameworkNoTarget test framework. Default: playwright.playwright
Behavior3/5

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

There are no annotations, so the description carries the behavioral burden. It discloses meaningful constraints: Sauce Demo data-test ids still emit getByTestId, and testid is never mapped to getByRole('generic'). However, the result format is only vaguely described as 'snippet with score and stability', leaving the return structure and score semantics underspecified.

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 only two sentences, with the core purpose in the first sentence and a high-value edge-case constraint in the second. Every sentence earns its place, and there is no filler.

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?

Given a small schema and no output schema, the description covers the action, the input domain, the target frameworks, and a meaningful mapping exception. It could have clarified the output structure and the meaning of stability, but it is complete enough for an agent to call the tool confidently.

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 input schema already covers all parameters with descriptions, so this is a baseline-3 case. The description re-emphasizes the {by, value} pair and framework context but adds no new semantic detail beyond what the schema provides.

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 opens with a specific verb, 'Map', and clearly identifies the resource: a PageSnap YAML locator converted into a Playwright, Selenium, or Cypress snippet. It also explains what the result contains — code, score, and stability. This clearly distinguishes the tool from the sibling tools, which are session-management operations.

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 intended use case is explicit: convert a PageSnap YAML locator into framework-specific code. It does not enumerate alternative tools or when-not-to-use conditions, but given that the siblings are list_sessions, read_session, and get_prompt, the usage boundary is effectively clear.

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/fredoz0999/pagesnap-mcp'

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