Skip to main content
Glama

exportScenarioAsCode

Convert recorded scenarios into test code for new files, optionally generating or using Page Object models.

Instructions

Export scenario as test code for NEW file. Supports Page Object integration: 'generate-integrated' generates POM + test using it, 'use-existing' generates test using existing POM file. Use appendScenarioToFile for existing files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageYesTarget test framework and language
scenarioNameYesName of scenario to export
cleanSelectorsNoRemove unstable CSS classes (default: true)
pageObjectFileNoPath to existing POM file (required for 'use-existing' mode)
pageObjectModeNoPOM integration: 'none' (default), 'generate' (separate POM), 'generate-integrated' (POM + test using it), 'use-existing' (test uses existing POM file)
includeCommentsNoInclude descriptive comments (default: true)
generatePageObjectNoAlso generate Page Object class for the page (default: false). Legacy - use pageObjectMode instead.
pageObjectClassNameNoPage Object class name (optional, auto-generated if not provided)
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool targets new files and describes POM integration behaviors, which adds context. However, it doesn't state whether the tool writes a file, returns code, or what happens if the file already exists, leaving side effects unclear.

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 two sentences, front-loaded with the core purpose, and includes necessary differentiation and mode explanations without excess. It could be slightly better organized, but it is appropriately concise.

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 tool with 8 parameters and no output schema, the description covers core purpose and main mode options but omits important behavior like return value, file creation details, or handling of optional parameters. It is adequate for a basic understanding but not fully complete for an agent deciding to invoke it.

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%, so the baseline is 3. The description repeats some enum semantics already present in the schema (e.g., pageObjectMode explanations) and adds the 'NEW file' context, but it doesn't significantly enhance understanding of parameters like cleanSelectors or includeComments 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 clearly states the tool exports a scenario as test code for a NEW file, which is a specific action on a specific resource. It explicitly distinguishes from appendScenarioToFile, making the purpose unambiguous and differentiating it from sibling tools.

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?

It directly says 'Use appendScenarioToFile for existing files,' providing a clear alternative for the append case. It also explains the different pageObjectMode options, giving context on when to choose each mode. However, it doesn't explicitly mention when not to use this tool for other scenarios, but the key alternative is named.

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