Skip to main content
Glama
raymondsambur

Automation Script Generator MCP Server

generate_feature_file

Create WDIO feature files using Gherkin syntax (Given, When, Then) for test automation. Define scenario titles, tags, and output paths to generate structured test files for WebDriverIO.

Instructions

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

Input Schema

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

Implementation Reference

  • Main handler function for 'generate_feature_file' tool. Extracts parameters, generates content using helper method, writes to output_path, and returns success response.
    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}`); }
  • Tool configuration including schema definition for input validation. Used for both listing tools and validating args before execution.
    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, }, },
  • index.js:348-350 (registration)
    Dispatch registration in CallToolRequestSchema handler: routes tool calls to the generateFeatureFile handler method.
    case 'generate_feature_file': return await this.generateFeatureFile(args); case 'generate_steps_file':
  • Helper method that constructs the Gherkin feature file content from title, syntax, and tags. Called by the handler.
    buildFeatureFileContent(scenario_title, gherkin_syntax, tags) { const tagString = tags.map(tag => `@${tag}`).join(' '); return `${tagString ? tagString + '\n' : ''}Feature: ${scenario_title} ${gherkin_syntax} `; }
  • index.js:330-334 (registration)
    Registers the tool for discovery: ListToolsRequestSchema returns the tool list including generate_feature_file config.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: toolConfigs, }; });

Other Tools

Related 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