Skip to main content
Glama
raymondsambur

Automation Script Generator MCP Server

generate_feature_file

Create WDIO feature files with Gherkin syntax for test automation scenarios, specifying scenario titles, steps, tags, and output paths.

Instructions

Generate WDIO feature file with Gherkin syntax (Given, When, Then)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scenario_titleYesTitle of the test scenario
gherkin_syntaxYesGherkin syntax content for the feature
tagsNoTest ID tags for the scenario
output_pathYesPath where the feature file should be saved

Implementation Reference

  • The primary handler function for the 'generate_feature_file' tool. It destructures the input arguments, generates the feature file content using an internal helper, ensures the output directory exists, writes the file, and returns a success response with the generated content.
    async generateFeatureFile(args) {
        const { scenario_title, gherkin_syntax, tags = [], output_path } = args;
    
        try {
            const featureContent = this.buildFeatureFileContent(scenario_title, gherkin_syntax, tags);
    
            await fs.ensureDir(path.dirname(output_path));
            await fs.writeFile(output_path, featureContent);
    
            return {
                content: [
                    {
                        type: 'text',
                        text: `Feature file generated successfully at: ${output_path}\n\nContent:\n${featureContent}`,
                    },
                ],
            };
        } catch (error) {
            throw new Error(`Failed to generate feature file: ${error.message}`);
        }
  • The JSON Schema defining the input parameters and validation rules for the generate_feature_file tool, including required fields and constraints.
    inputSchema: {
        type: 'object',
        properties: {
            scenario_title: {
                type: 'string',
                description: 'Title of the test scenario',
                minLength: 1,
            },
            gherkin_syntax: {
                type: 'string',
                description: 'Gherkin syntax content for the feature',
                minLength: 1,
            },
            tags: {
                type: 'array',
                items: { type: 'string' },
                description: 'Test ID tags for the scenario',
            },
            output_path: {
                type: 'string',
                description: 'Path where the feature file should be saved',
                minLength: 1,
            },
        },
        required: ['scenario_title', 'gherkin_syntax', 'output_path'],
        additionalProperties: false,
  • index.js:173-202 (registration)
    The tool configuration object in the toolConfigs array, which registers the generate_feature_file tool with its name, description, and schema for the MCP server's listTools response.
        name: 'generate_feature_file',
        description: 'Generate WDIO feature file with Gherkin syntax (Given, When, Then)',
        inputSchema: {
            type: 'object',
            properties: {
                scenario_title: {
                    type: 'string',
                    description: 'Title of the test scenario',
                    minLength: 1,
                },
                gherkin_syntax: {
                    type: 'string',
                    description: 'Gherkin syntax content for the feature',
                    minLength: 1,
                },
                tags: {
                    type: 'array',
                    items: { type: 'string' },
                    description: 'Test ID tags for the scenario',
                },
                output_path: {
                    type: 'string',
                    description: 'Path where the feature file should be saved',
                    minLength: 1,
                },
            },
            required: ['scenario_title', 'gherkin_syntax', 'output_path'],
            additionalProperties: false,
        },
    },
  • Helper method used by the handler to construct the Gherkin feature file content from scenario title, syntax, and tags.
        buildFeatureFileContent(scenario_title, gherkin_syntax, tags) {
            const tagString = tags.map(tag => `@${tag}`).join(' ');
    
            return `${tagString ? tagString + '\n' : ''}Feature: ${scenario_title}
    
    ${gherkin_syntax}
    `;
        }
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 file but does not cover critical aspects such as file overwriting behavior, error handling, permissions required for saving to 'output_path', or what happens if the path is invalid. This is inadequate for a tool that creates files.

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?

The description is a single, efficient sentence that directly states the tool's purpose without redundancy. It is appropriately sized and front-loaded, with no wasted words, making it easy for an agent to parse quickly.

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 file generation with no annotations or output schema, the description is incomplete. It lacks information on behavioral traits (e.g., file creation/overwrite rules), error conditions, and output details, which are essential for safe and effective tool invocation in a testing context.

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, providing clear details for all 4 parameters. The description adds no additional semantic context beyond implying Gherkin syntax usage, which is already covered in the schema. This meets the baseline of 3 when schema coverage is high.

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 WDIO feature file with Gherkin syntax (Given, When, Then)'. It specifies the verb ('Generate'), resource ('WDIO feature file'), and syntax format ('Gherkin syntax'), but does not explicitly differentiate it from sibling tools like 'generate_component_file' or 'generate_page_file', which prevents a score of 5.

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 does not mention sibling tools like 'generate_steps_file' or 'process_test_scenario', nor does it specify prerequisites, exclusions, or contexts for usage, leaving the agent with insufficient direction.

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/raymondsambur/automation-script-generator'

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