warden_stop_project
Stop a Warden-managed Magento 2 development environment to halt services and free system resources. Provide the project directory path to execute this action.
Instructions
Stop a Warden project environment
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | Path to the project directory |
Implementation Reference
- server.js:520-527 (handler)The handler function that executes the tool logic: extracts project_path from arguments and calls executeWardenCommand with 'warden env down' to stop the Warden project environment.async stopProject(args) { const { project_path } = args; return await this.executeWardenCommand( project_path, ["env", "down"], "Stopping Warden project environment", ); }
- server.js:61-70 (schema)Input schema definition for the warden_stop_project tool, requiring project_path.inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the project directory", }, }, required: ["project_path"], },
- server.js:325-326 (registration)Registration in the CallToolRequestSchema switch statement that dispatches calls to the stopProject handler.case "warden_stop_project": return await this.stopProject(request.params.arguments);
- server.js:58-71 (registration)Tool registration in the ListToolsRequestSchema response, including name, description, and schema.{ name: "warden_stop_project", description: "Stop a Warden project environment", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the project directory", }, }, required: ["project_path"], }, },
- server.js:831-876 (helper)Helper function used by stopProject to execute the warden command, handle errors, and format the response.async executeWardenCommand(project_path, wardenArgs, description) { if (!project_path) { throw new Error("project_path is required"); } const normalizedProjectPath = project_path.replace(/\/+$/, ""); const absoluteProjectPath = resolve(normalizedProjectPath); if (!existsSync(absoluteProjectPath)) { throw new Error( `Project directory does not exist: ${absoluteProjectPath}`, ); } try { const result = await this.executeCommand( "warden", wardenArgs, absoluteProjectPath, ); const commandStr = `warden ${wardenArgs.join(" ")}`; const isSuccess = result.code === 0; return { content: [ { type: "text", text: `${description} ${isSuccess ? "completed successfully" : "failed"}!\n\nCommand: ${commandStr}\nWorking directory: ${absoluteProjectPath}\nExit Code: ${result.code}\n\nOutput:\n${result.stdout || "(no output)"}\n\nErrors:\n${result.stderr || "(no errors)"}`, }, ], isError: !isSuccess, }; } catch (error) { const commandStr = `warden ${wardenArgs.join(" ")}`; return { content: [ { type: "text", text: `Failed to execute command:\n\nCommand: ${commandStr}\nWorking directory: ${absoluteProjectPath}\nError: ${error.message}\n\nOutput:\n${error.stdout || "(no output)"}\n\nErrors:\n${error.stderr || "(no errors)"}`, }, ], isError: true, }; } }