Skip to main content
Glama

generate_page_object

Create Page Object Model classes for web automation testing. Generates code for Playwright or Selenium frameworks to structure test automation with reusable page elements.

Instructions

Generate a complete Page Object Model class for a webpage. Supports Playwright (TypeScript/JavaScript/Python) and Selenium (Java/Python/C#).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the webpage
classNameYesName for the Page Object class (e.g., 'LoginPage', 'CheckoutPage')
languageNoProgramming language: typescript, javascript, python (Playwright) OR java-selenium, python-selenium, csharp-selenium (Selenium)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'generates' a class, implying a creation or write operation, but doesn't disclose any behavioral traits like whether it requires internet access, how it handles invalid URLs, if it has rate limits, or what the output format is (e.g., code string, file). For a tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, stating the core purpose in the first sentence and adding framework support in the second. Both sentences earn their place by clarifying scope, and there's no redundant information. However, it could be slightly more structured by explicitly separating the purpose from usage notes, but it remains efficient overall.

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

Completeness2/5

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

Given the complexity of generating code (a Page Object Model class) and the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a code snippet, a file download), any error conditions, or behavioral details like execution time or dependencies. For a tool with no structured output and no annotations, this leaves the agent with insufficient context to use it effectively.

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 has 100% description coverage, clearly documenting all three parameters (url, className, language) with descriptions and an enum for language. The description adds minimal value beyond the schema, only implying that the tool uses the URL to generate the class and mentioning the supported frameworks, which aligns with the language parameter's enum. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't provide additional semantic context like examples or constraints.

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 clearly states the tool's purpose: 'Generate a complete Page Object Model class for a webpage.' It specifies the verb ('generate') and resource ('Page Object Model class'), and mentions supported frameworks (Playwright and Selenium). However, it doesn't explicitly differentiate from sibling tools like 'get_locators' or 'generate_test', which might also involve page elements or test generation, leaving some ambiguity about its unique role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions supported frameworks but doesn't specify scenarios where generating a Page Object Model is preferred over using sibling tools like 'analyze_page' or 'generate_test'. There's no mention of prerequisites, such as needing a valid URL or when this tool might be inappropriate, leaving the agent without context for selection.

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/naveenanimation20/locatorlabs-mcp'

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