Skip to main content
Glama

generatePageObject

Generate Page Object Model classes from current page analysis, extracting interactive elements and auto-generating framework-specific code for Playwright or Selenium.

Instructions

Generate Page Object Model (POM) class from current page analysis. Analyzes page structure, extracts interactive elements (inputs, buttons, links), groups them by sections (header, nav, form, etc.), and generates framework-specific code. Supports Playwright (TypeScript/Python) and Selenium (Python/Java). Auto-generates smart element names and helper methods.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
classNameNoPage Object class name (optional, auto-generated from page title/URL if not provided)
frameworkNoTarget test framework (default: playwright-typescript)
groupElementsNoGroup elements by page sections (default: true)
includeCommentsNoInclude descriptive comments in generated code (default: true)
Behavior3/5

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

With no annotations, the description carries full burden. It discloses analysis, element extraction, grouping, and helper generation, but leaves ambiguous whether the tool writes files, returns code to the UI, or requires a prior analyzePage call. The lack of side-effect or prerequisite disclosure is a significant gap.

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?

Three sentences, front-loaded with the primary purpose. Each sentence adds distinct value: generation of POM, the analysis/extraction/grouping behavior, and supported frameworks. No redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is moderately complex with four parameters and no output schema. The description explains what the generated code does at a high level but omits how the code is returned/stored and whether a prior analysis step is mandatory. This incomplete output/usage contract lowers completeness.

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?

All four parameters have schema descriptions (100% coverage), so baseline is 3. The description adds minor context (grouping to sections, framework support) but doesn't clarify parameter values or interactions beyond what the schema already 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?

Description opens with a specific verb-resource pair: 'Generate Page Object Model (POM) class from current page analysis.' It goes on to detail the analysis and generation behaviors (extracting elements, grouping by sections, framework-specific code), which clearly distinguishes it from sibling tools like generateApiModels or convertFigmaToCode.

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 phrase 'from current page analysis' implies a workflow dependency but does not explicitly state when to use this tool versus alternatives like analyzePage or other generators. It lists supported frameworks but gives no exclusions, alternatives, or prerequisites, so usage context is only implied.

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/docentovich/chrometools-mcp'

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