Skip to main content
Glama

Page object for a framework

get_page_object
Read-only

Exports browser-collected selectors as a ready-to-use page object for your chosen test framework, converting each element into Playwright, Selenium, Cypress, or other framework-specific selectors.

Instructions

Exports the selectors collected in the browser as a ready page object. The best selector differs per framework: Playwright can match a role and an accessible name, Selenium cannot and falls back to CSS or XPath for the same element, so always pass the framework you are actually writing for.

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": {
      "framework": "<framework>"
    },
    "name": "get_page_object"
  }
}

Input Schema

NameRequiredDescriptionDefault
frameworkYesThe test framework the output should be written for.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.3

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds genuinely useful behavioral context beyond that: output quality and selector strategy vary by framework, and Selenium cannot express role+accessible-name matches. It omits prerequisites (does the page need capturing/selectors collecting first?) and gives no hint about the shape of the exported artifact (text, file path, snippet), which is a meaningful gap for a tool with no output schema.

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?

Three sentences, front-loaded with the verb and result, then the framework caveat and the directive to pass the real target. Every sentence carries information; the only slight redundancy is restating the framework requirement that the schema already enforces as required.

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?

For a single-parameter, read-only tool this is close to sufficient, but with no output schema the description should say what the exported page object actually looks like and whether prior capture/collection steps are prerequisites. As written, an agent knows what the tool does and which framework value to send, but not the workflow position or the return form.

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 coverage is 100% and the single enum parameter is fully enumerated, so the baseline is 3. The description does add meaning over the schema by explaining that the framework choice determines which selector strategy is emitted and why some targets degrade to CSS/XPath, but it adds nothing about the individual enum values such as xpath, css, or json, which are not obvious from 'the test framework the output should be written for.'

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 opening sentence gives a specific verb and object: 'Exports the selectors collected in the browser as a ready page object.' That is clearly distinct from collection siblings such as collect_selectors or verify_selectors, since it frames itself as the export/codegen step over already-collected data. It stops short of naming an explicit alternative, so it sits at 4 rather than 5.

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 description contains real guidance for the framework input ('always pass the framework you are actually writing for') and explains the consequence of choosing wrongly by comparing Playwright role/accessible-name matching against Selenium's CSS/XPath fallback. It never states when this tool should be used versus sibling tools, nor whether selectors must already be collected first, so usage is only implied by the phrase 'selectors collected in the browser'.

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