Skip to main content
Glama

Generate POM

generate_pom

Generates a functional TypeScript Page Object Model file from a live Playwright accessibility snapshot, optionally opening a headed browser to log in or reach the needed page state first.

Instructions

Generate a functional Page Object Model TypeScript file from a live Playwright accessibility snapshot. Optionally launches a headed browser so you can log in or navigate to the desired state first.

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>",
      "name": "<name>",
      "outputDir": "<outputDir>"
    },
    "name": "generate_pom"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesStarting URL to navigate to
nameYesOutput name (e.g. "checkout" → checkout.page.ts + checkout.snapshot.yml)
styleNoPOM style: factory function (default) or class-basedfactory
timeoutNoMilliseconds to wait for waitForUrl
outputDirYesDirectory to write generated files into
waitForUrlNoURL glob pattern; when set the browser launches headed so you can manually navigate first

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.6/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 disclosure burden. It usefully reveals the headed-browser side effect and that the process may pause for human login/navigation, which is real behavioral insight beyond the schema. However, it says nothing about file-write semantics: whether existing files are overwritten, whether outputDir must exist, or what happens on timeout — significant for a tool that writes to disk and drives a browser.

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, front-loaded with the core action, and the optional human-in-the-loop behavior follows immediately. No filler, no redundancy.

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 six-parameter generation tool with no output schema, the definition covers the essential purpose, the live-snapshot source, and the headed-browser behavior. What is missing is modest but real: no statement of what is returned (file paths?) and no overwrite/error behavior, which an agent would want before invoking it on an existing output directory.

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%, so every parameter (url, name, style, timeout, outputDir, waitForUrl) is already documented and the baseline is 3. The description adds framing — that the snapshot comes from a live page and that a headed browser may be involved — but no format or syntax detail beyond the schema.

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 names a concrete verb plus product: generating a Page Object Model TypeScript file from a live Playwright accessibility snapshot. That is specific enough to know exactly what the tool produces. It stops short of a 5 because nothing distinguishes it from related codegen or snapshot tools (no siblings are listed, so the omission is understandable but still a gap).

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?

"Optionally launches a headed browser so you can log in or navigate to the desired state first" implies when headed mode matters, but it never states that the headed launch is triggered by setting waitForUrl — an agent must infer that link from the schema. No prerequisites (Playwright installed, browser binaries, credentials needed) and no when-not-to-use guidance are given.

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