reset_environment
Reset a QIT test environment's database to its initial post-setup state for clean testing conditions.
Instructions
Reset a QIT test environment's database to the post-setup state.
⚠️ QIT CLI not detected. QIT CLI not found. Please install it using one of these methods:
Via Composer (recommended): composer require woocommerce/qit-cli --dev
Set QIT_CLI_PATH environment variable: export QIT_CLI_PATH=/path/to/qit
Ensure 'qit' is available in your system PATH
For more information, visit: https://github.com/woocommerce/qit-cli
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env_id | No | Environment ID to reset. If not provided, resets the most recent environment. |
Implementation Reference
- src/tools/environment.ts:302-306 (handler)The handler function implementing the reset_environment tool. It builds CLI arguments for the 'qit env:reset' command, optionally using the provided env_id or defaulting to the most recent environment, and executes it using helper functions.handler: async (args: { env_id?: string }) => { const positional = args.env_id ? [args.env_id] : []; const cmdArgs = buildArgs("env:reset", positional, {}); return executeAndFormat(cmdArgs); },
- src/tools/environment.ts:294-301 (schema)The Zod input schema defining the parameters for the reset_environment tool: an optional env_id string.inputSchema: z.object({ env_id: z .string() .optional() .describe( "Environment ID to reset. If not provided, resets the most recent environment." ), }),
- src/tools/environment.ts:290-307 (registration)The complete tool definition object for 'reset_environment' within the environmentTools export, which is aggregated into allTools and registered in the MCP server.reset_environment: { name: "reset_environment", description: "Reset a QIT test environment's database to the post-setup state.", inputSchema: z.object({ env_id: z .string() .optional() .describe( "Environment ID to reset. If not provided, resets the most recent environment." ), }), handler: async (args: { env_id?: string }) => { const positional = args.env_id ? [args.env_id] : []; const cmdArgs = buildArgs("env:reset", positional, {}); return executeAndFormat(cmdArgs); }, },