Skip to main content
Glama
lucad87

MCP Server - Test Migration (WDIO to Playwright)

by lucad87

analyze_wdio_test

Analyzes WebDriverIO test files to extract structure, selectors, and commands, identifying migration readiness for Playwright conversion.

Instructions

Analyzes a WebDriverIO test file using AST parsing and extracts detailed information about its structure, selectors, commands, and dependencies. Detects if test is already partially migrated to Playwright.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testContentYesThe complete content of the WDIO test file to analyze
filePathNoOptional file path for context

Implementation Reference

  • The handler function that analyzes WDIO test code, parsing the AST, detecting framework, and generating insights and recommendations.
    export async function handleAnalyzeWdioTest(args) {
      const { testContent, filePath = 'unknown.js' } = args;
    
      const ast = parseCode(testContent);
      const framework = detectFramework(ast);
      const astInfo = extractAstInfo(ast);
      const selectorSuggestions = generateSelectorSuggestions(astInfo.selectors);
    
      const analysis = {
        filePath,
        framework,
        structure: {
          imports: astInfo.imports,
          describes: astInfo.describes,
          tests: astInfo.tests,
          hooks: astInfo.hooks,
        },
        selectors: {
          found: astInfo.selectors,
          suggestions: selectorSuggestions,
        },
        commands: astInfo.commands,
        assertions: astInfo.assertions,
        pageObjects: astInfo.pageObjectUsage,
        tags: astInfo.tags,
        complexity: calculateComplexity(astInfo),
        recommendations: generateRecommendations(framework, astInfo),
      };
    
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(analysis, null, 2),
        }],
      };
    }
Behavior3/5

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

With no annotations provided, the description must carry the full burden. It successfully discloses the implementation method (AST parsing) and specific extraction targets, but fails to explicitly confirm this is a read-only/safe operation or describe the return format/structure despite the absence of an 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste. The first sentence front-loads the core action, method, and primary outputs. The second sentence adds the specific migration-detection capability that differentiates this from generic analysis tools. Every word earns its place.

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?

The description adequately covers the input processing logic but leaves gaps given the lack of annotations and output schema. It omits safety guarantees (read-only status), return value structure, and how this analysis feeds into the broader migration workflow suggested by sibling tools. Sufficient for basic invocation but incomplete for full 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?

Schema description coverage is 100%, with testContent and filePath fully documented. The description references 'WebDriverIO test file' which aligns with the testContent parameter, but adds no additional semantic context (e.g., expected file size limits, syntax requirements) beyond what the schema already provides, warranting the baseline score.

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 provides a specific verb ('Analyzes'), target resource ('WebDriverIO test file'), method ('AST parsing'), and detailed outputs ('structure, selectors, commands, and dependencies'). It distinguishes from siblings like detect_project_state by specifying single-file AST analysis and from migrate_to_playwright by clarifying this is analysis-only with a specific focus on detecting partial migration status.

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?

While the description clearly states what the tool does, it lacks explicit guidance on when to use it versus siblings like detect_project_state (project-wide analysis) or migrate_to_playwright (actual transformation). The usage is implied by the functionality but no explicit 'when-to-use' or workflow prerequisites are provided.

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