Skip to main content
Glama
lucad87

MCP Server - Test Migration (WDIO to Playwright)

by lucad87

generate_migration_report

Generate a migration report in markdown format to document test automation migration from WebDriverIO to Playwright, including test files, tags, status, and statistics.

Instructions

Generates a comprehensive migration report as a markdown file. Includes test files, tags, migration status, and statistics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
migratedTestsYesJSON string array of migrated test information with file paths, tags, and status
projectNameNoName of the project for the report header

Implementation Reference

  • Handler function for 'generate_migration_report' tool. It receives the test data, parses it, and calls the generateMigrationReport utility.
    export async function handleGenerateMigrationReport(args) {
      const { migratedTests, projectName = 'Test Migration' } = args;
    
      let tests = [];
      try {
        tests = JSON.parse(migratedTests);
      } catch (e) {
        return {
          content: [{
            type: 'text',
            text: 'Error: migratedTests must be a valid JSON array',
          }],
          isError: true,
        };
      }
    
      const report = generateMigrationReport(tests, projectName);
    
      return {
        content: [{
          type: 'text',
          text: report,
        }],
      };
    }
  • Utility function that generates the actual markdown migration report.
    export function generateMigrationReport(tests, projectName = 'Test Migration') {
      const now = new Date().toISOString();
      const stats = calculateMigrationStats(tests);
      const tagSummary = generateTagSummary(tests);
      const fileList = generateFileList(tests);
      const testRows = generateTestRows(tests);
    
      return `# ${projectName} - Migration Report
    
    **Generated:** ${now}
    **Tool Version:** MCP Test Migration Server v2.1.0
    
    ---
    
    ## ๐Ÿ“Š Migration Summary
    
    | Metric | Count |
    |--------|-------|
    | Total Tests | ${stats.total} |
    | Migrated | ${stats.migrated} |
    | Pending | ${stats.pending} |
    | Failed | ${stats.failed} |
    | **Success Rate** | **${stats.successRate}%** |
    
    ---
    
    ## ๐Ÿท๏ธ Tags Summary
    
    ${tagSummary}
    
    ---
    
    ## ๐Ÿ“ Files
    
    ### Migrated Files
    
    ${fileList.migrated}
    
    ### Pending Files
    
    ${fileList.pending}
    
    ### Failed Files
    
    ${fileList.failed}
    
    ---
    
    ## ๐Ÿ“‹ Detailed Test List
    
    | Original File | Migrated File | Status | Tags |
    |--------------|---------------|--------|------|
    ${testRows}
    
    ---
    
    ## ๐Ÿ”ง Next Steps
    
    1. Review migrated tests for any manual adjustments
    2. Run tests: \`npx playwright test\`
    3. Run specific tags: \`npx playwright test --grep @smoke\`
    4. View report: \`npx playwright show-report\`
    
    ---
    
    ## ๐Ÿ“š Resources
    
    - [Playwright Documentation](https://playwright.dev/docs/intro)
    - [Playwright Test Annotations](https://playwright.dev/docs/test-annotations)
    - [Playwright Locators](https://playwright.dev/docs/locators)
    `;
    }
  • src/server.js:102-102 (registration)
    Tool registration for 'generate_migration_report' in the server implementation.
    'generate_migration_report': handleGenerateMigrationReport,
Behavior2/5

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

No annotations provided, so description carries full burden. Mentions output format (markdown file) but omits critical behavioral traits: side effects (file system write location/overwrite behavior), return value format, and idempotency. 'Generates' implies mutation but lacks safety context.

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?

Two efficient sentences with zero waste. First sentence establishes purpose and format; second details content. Front-loaded and appropriately sized for tool complexity.

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?

Adequate for a 2-parameter tool with full schema coverage. However, lacking output schema, description should indicate what is returned (file path, content, or status) but only states 'generates... file' without specifying the return value.

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 has 100% description coverage, establishing baseline of 3. Description mentions report contents ('test files, tags, migration status, and statistics') which aligns with migratedTests parameter, but adds no syntax guidance or examples beyond schema.

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?

Description uses specific verb 'Generates' with clear resource 'migration report' and output format 'markdown file'. Distinct from sibling tools focused on analysis, migration, or refactoringโ€”this is the only reporting tool.

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?

No explicit guidance on when to use versus alternatives, or prerequisites (e.g., whether to run after migration completes). Lacks 'when-not' guidance despite multiple sibling migration tools where sequencing matters.

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/lucad87/mcp-server-tests-migration'

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