Skip to main content
Glama

start_environment

Creates a temporary local test environment for WordPress/WooCommerce testing with customizable PHP, plugin, and theme configurations.

Instructions

Start a local QIT test environment. Creates a temporary, ephemeral environment for testing.

⚠️ QIT CLI not detected. QIT CLI not found. Please install it using one of these methods:

  1. Via Composer (recommended): composer require woocommerce/qit-cli --dev

  2. Set QIT_CLI_PATH environment variable: export QIT_CLI_PATH=/path/to/qit

  3. Ensure 'qit' is available in your system PATH

For more information, visit: https://github.com/woocommerce/qit-cli

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environment_typeNoType of environment to create: 'e2e' or 'performance'
php_versionNoPHP version to use (e.g., '8.1', '8.2', '8.3')
wp_versionNoWordPress version to use (e.g., '6.4', '6.5', 'stable', 'rc')
wc_versionNoWooCommerce version to use (e.g., '8.5', '9.0', 'latest')
pluginsNoPlugins to install (slug, path, or URL)
themesNoThemes to install (slug, path, or URL)
test_packagesNoTest packages to set up environment from
utilitiesNoUtility packages for environment setup
volumesNoDocker volumes to mount (host:container format)
php_extensionsNoPHP extensions to enable
env_varsNoEnvironment variables to set (key-value pairs)
object_cacheNoEnable Redis object cache
tunnelNoEnable tunnelling method (cloudflare, ngrok)
configNoPath to qit.json configuration file
skip_setupNoSkip running setup phases even if qit-test.json is found
skip_activating_pluginsNoSkip activating plugins during environment setup
skip_activating_themesNoSkip activating themes during environment setup
jsonNoReturn output in JSON format

Implementation Reference

  • The async handler function that implements the core logic of the 'start_environment' tool by mapping input arguments to QIT CLI flags, building the 'qit env:up' command arguments, and executing it via executeAndFormat with a 10-minute timeout.
    handler: async (args: {
      environment_type?: (typeof environmentTypes)[number];
      php_version?: string;
      wp_version?: string;
      wc_version?: string;
      plugins?: string[];
      themes?: string[];
      test_packages?: string[];
      utilities?: string[];
      volumes?: string[];
      php_extensions?: string[];
      env_vars?: Record<string, string>;
      object_cache?: boolean;
      tunnel?: (typeof tunnelMethods)[number];
      config?: string;
      skip_setup?: boolean;
      skip_activating_plugins?: boolean;
      skip_activating_themes?: boolean;
      json?: boolean;
    }) => {
      // Use canonical flag names from the trunk QIT CLI
      // These support aliases (--wp, --woo) for backwards compatibility
      const flags: Record<string, string | boolean | undefined> = {
        environment_type: args.environment_type,
        php_version: args.php_version,
        wordpress_version: args.wp_version,
        woocommerce_version: args.wc_version,
        object_cache: args.object_cache,
        tunnel: args.tunnel,
        config: args.config,
        "skip-setup": args.skip_setup,
        skip_activating_plugins: args.skip_activating_plugins,
        skip_activating_themes: args.skip_activating_themes,
        json: args.json,
      };
    
      const cmdArgs = buildArgs("env:up", [], flags);
    
      // Add array-based flags
      if (args.plugins?.length) {
        for (const plugin of args.plugins) {
          cmdArgs.push("--plugin", plugin);
        }
      }
      if (args.themes?.length) {
        for (const theme of args.themes) {
          cmdArgs.push("--theme", theme);
        }
      }
      if (args.test_packages?.length) {
        for (const pkg of args.test_packages) {
          cmdArgs.push("--test-package", pkg);
        }
      }
      if (args.utilities?.length) {
        for (const util of args.utilities) {
          cmdArgs.push("--utility", util);
        }
      }
      if (args.volumes?.length) {
        for (const volume of args.volumes) {
          cmdArgs.push("--volume", volume);
        }
      }
      if (args.php_extensions?.length) {
        for (const ext of args.php_extensions) {
          cmdArgs.push("--php_extension", ext);
        }
      }
      if (args.env_vars) {
        for (const [key, value] of Object.entries(args.env_vars)) {
          cmdArgs.push("--env", `${key}=${value}`);
        }
      }
    
      // Environment startup can take a while
      return executeAndFormat(cmdArgs, { timeout: 600000 });
    },
  • Zod inputSchema object defining the structure and descriptions of all input parameters for the start_environment tool, including environment_type, php_version, wp_version, plugins, themes, tunnel options, and more.
    inputSchema: z.object({
      environment_type: z
        .enum(environmentTypes)
        .optional()
        .describe("Type of environment to create: 'e2e' or 'performance'"),
      php_version: z
        .string()
        .optional()
        .describe("PHP version to use (e.g., '8.1', '8.2', '8.3')"),
      wp_version: z
        .string()
        .optional()
        .describe("WordPress version to use (e.g., '6.4', '6.5', 'stable', 'rc')"),
      wc_version: z
        .string()
        .optional()
        .describe("WooCommerce version to use (e.g., '8.5', '9.0', 'latest')"),
      plugins: z
        .array(z.string())
        .optional()
        .describe("Plugins to install (slug, path, or URL)"),
      themes: z
        .array(z.string())
        .optional()
        .describe("Themes to install (slug, path, or URL)"),
      test_packages: z
        .array(z.string())
        .optional()
        .describe("Test packages to set up environment from"),
      utilities: z
        .array(z.string())
        .optional()
        .describe("Utility packages for environment setup"),
      volumes: z
        .array(z.string())
        .optional()
        .describe("Docker volumes to mount (host:container format)"),
      php_extensions: z
        .array(z.string())
        .optional()
        .describe("PHP extensions to enable"),
      env_vars: z
        .record(z.string())
        .optional()
        .describe("Environment variables to set (key-value pairs)"),
      object_cache: z
        .boolean()
        .optional()
        .describe("Enable Redis object cache"),
      tunnel: z
        .enum(tunnelMethods)
        .optional()
        .describe("Enable tunnelling method (cloudflare, ngrok)"),
      config: z
        .string()
        .optional()
        .describe("Path to qit.json configuration file"),
      skip_setup: z
        .boolean()
        .optional()
        .describe("Skip running setup phases even if qit-test.json is found"),
      skip_activating_plugins: z
        .boolean()
        .optional()
        .describe("Skip activating plugins during environment setup"),
      skip_activating_themes: z
        .boolean()
        .optional()
        .describe("Skip activating themes during environment setup"),
      json: z
        .boolean()
        .optional()
        .describe("Return output in JSON format"),
    }),
  • The 'start_environment' tool object definition, specifying name, description, inputSchema, and handler function, exported as part of the environmentTools object.
    start_environment: {
      name: "start_environment",
      description:
        "Start a local QIT test environment. Creates a temporary, ephemeral environment for testing.",
      inputSchema: z.object({
        environment_type: z
          .enum(environmentTypes)
          .optional()
          .describe("Type of environment to create: 'e2e' or 'performance'"),
        php_version: z
          .string()
          .optional()
          .describe("PHP version to use (e.g., '8.1', '8.2', '8.3')"),
        wp_version: z
          .string()
          .optional()
          .describe("WordPress version to use (e.g., '6.4', '6.5', 'stable', 'rc')"),
        wc_version: z
          .string()
          .optional()
          .describe("WooCommerce version to use (e.g., '8.5', '9.0', 'latest')"),
        plugins: z
          .array(z.string())
          .optional()
          .describe("Plugins to install (slug, path, or URL)"),
        themes: z
          .array(z.string())
          .optional()
          .describe("Themes to install (slug, path, or URL)"),
        test_packages: z
          .array(z.string())
          .optional()
          .describe("Test packages to set up environment from"),
        utilities: z
          .array(z.string())
          .optional()
          .describe("Utility packages for environment setup"),
        volumes: z
          .array(z.string())
          .optional()
          .describe("Docker volumes to mount (host:container format)"),
        php_extensions: z
          .array(z.string())
          .optional()
          .describe("PHP extensions to enable"),
        env_vars: z
          .record(z.string())
          .optional()
          .describe("Environment variables to set (key-value pairs)"),
        object_cache: z
          .boolean()
          .optional()
          .describe("Enable Redis object cache"),
        tunnel: z
          .enum(tunnelMethods)
          .optional()
          .describe("Enable tunnelling method (cloudflare, ngrok)"),
        config: z
          .string()
          .optional()
          .describe("Path to qit.json configuration file"),
        skip_setup: z
          .boolean()
          .optional()
          .describe("Skip running setup phases even if qit-test.json is found"),
        skip_activating_plugins: z
          .boolean()
          .optional()
          .describe("Skip activating plugins during environment setup"),
        skip_activating_themes: z
          .boolean()
          .optional()
          .describe("Skip activating themes during environment setup"),
        json: z
          .boolean()
          .optional()
          .describe("Return output in JSON format"),
      }),
      handler: async (args: {
        environment_type?: (typeof environmentTypes)[number];
        php_version?: string;
        wp_version?: string;
        wc_version?: string;
        plugins?: string[];
        themes?: string[];
        test_packages?: string[];
        utilities?: string[];
        volumes?: string[];
        php_extensions?: string[];
        env_vars?: Record<string, string>;
        object_cache?: boolean;
        tunnel?: (typeof tunnelMethods)[number];
        config?: string;
        skip_setup?: boolean;
        skip_activating_plugins?: boolean;
        skip_activating_themes?: boolean;
        json?: boolean;
      }) => {
        // Use canonical flag names from the trunk QIT CLI
        // These support aliases (--wp, --woo) for backwards compatibility
        const flags: Record<string, string | boolean | undefined> = {
          environment_type: args.environment_type,
          php_version: args.php_version,
          wordpress_version: args.wp_version,
          woocommerce_version: args.wc_version,
          object_cache: args.object_cache,
          tunnel: args.tunnel,
          config: args.config,
          "skip-setup": args.skip_setup,
          skip_activating_plugins: args.skip_activating_plugins,
          skip_activating_themes: args.skip_activating_themes,
          json: args.json,
        };
    
        const cmdArgs = buildArgs("env:up", [], flags);
    
        // Add array-based flags
        if (args.plugins?.length) {
          for (const plugin of args.plugins) {
            cmdArgs.push("--plugin", plugin);
          }
        }
        if (args.themes?.length) {
          for (const theme of args.themes) {
            cmdArgs.push("--theme", theme);
          }
        }
        if (args.test_packages?.length) {
          for (const pkg of args.test_packages) {
            cmdArgs.push("--test-package", pkg);
          }
        }
        if (args.utilities?.length) {
          for (const util of args.utilities) {
            cmdArgs.push("--utility", util);
          }
        }
        if (args.volumes?.length) {
          for (const volume of args.volumes) {
            cmdArgs.push("--volume", volume);
          }
        }
        if (args.php_extensions?.length) {
          for (const ext of args.php_extensions) {
            cmdArgs.push("--php_extension", ext);
          }
        }
        if (args.env_vars) {
          for (const [key, value] of Object.entries(args.env_vars)) {
            cmdArgs.push("--env", `${key}=${value}`);
          }
        }
    
        // Environment startup can take a while
        return executeAndFormat(cmdArgs, { timeout: 600000 });
      },
    },
  • Central aggregation of all tool sets (including environmentTools with start_environment) into the allTools object, which is imported and used by the MCP server for tool registration.
    export const allTools = {
      ...authTools,
      ...testExecutionTools,
      ...testResultsTools,
      ...groupsTools,
      ...environmentTools,
      ...packagesTools,
      ...configTools,
      ...utilitiesTools,
    };
  • src/server.ts:25-38 (registration)
    MCP server request handler for listing tools, which iterates over allTools to produce the list of available tools including start_environment with their schemas.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      // Check if QIT CLI is available
      const cliInfo = detectQitCli();
    
      const tools = Object.entries(allTools).map(([_, tool]) => ({
        name: tool.name,
        description: cliInfo
          ? tool.description
          : `${tool.description}\n\n⚠️ QIT CLI not detected. ${getQitCliNotFoundError()}`,
        inputSchema: zodToJsonSchema(tool.inputSchema),
      }));
    
      return { tools };
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the environment is 'temporary, ephemeral' which is useful context, but doesn't describe what happens when starting fails, whether this requires specific permissions, what resources are consumed, or what the typical runtime behavior looks like. For a complex 18-parameter tool with no annotations, this is insufficient behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

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

The description is poorly structured and not appropriately sized. The first two sentences describe the tool's purpose, but the remaining 80% is installation troubleshooting that doesn't belong in a tool description. This violates front-loading principles and includes content that should be in error messages or documentation links rather than the core description.

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 tool's complexity (18 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what happens after starting the environment, how to interact with it, what success/failure looks like, or how this integrates with the broader testing workflow. The installation troubleshooting doesn't compensate for these gaps in explaining the tool's role and behavior.

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%, so the schema already documents all 18 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema. According to scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in description, which applies here.

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: 'Start a local QIT test environment. Creates a temporary, ephemeral environment for testing.' This specifies the verb ('Start'), resource ('local QIT test environment'), and key characteristics ('temporary, ephemeral'). However, it doesn't explicitly differentiate from sibling tools like 'reset_environment' or 'stop_environment' beyond the 'start' action.

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. While it mentions prerequisites (QIT CLI installation), it doesn't explain when to start an environment versus using existing ones, or how this relates to siblings like 'list_environments', 'reset_environment', or 'run_test'. The installation instructions are helpful but don't constitute usage guidelines.

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/woocommerce/qit-mcp'

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