rolldev_stop_project
Stop a RollDev project environment to halt running services and free up resources. Provide the project directory path to safely terminate the environment.
Instructions
Stop a RollDev project environment
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | Path to the project directory |
Implementation Reference
- server.js:527-534 (handler)The stopProject() method is the handler for the 'rolldev_stop_project' tool. It extracts project_path from args and calls executeRollCommand with ['env', 'down'] to stop the RollDev project environment.
async stopProject(args) { const { project_path } = args; return await this.executeRollCommand( project_path, ["env", "down"], "Stopping RollDev project environment", ); } - server.js:113-126 (schema)The tool registration with its input schema. Defines the 'rolldev_stop_project' tool requiring a single 'project_path' string parameter.
{ name: "rolldev_stop_project", description: "Stop a RollDev project environment", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the project directory", }, }, required: ["project_path"], }, }, - server.js:299-300 (registration)The case branch in the CallToolRequestSchema handler that dispatches 'rolldev_stop_project' to the stopProject method.
case "rolldev_stop_project": return await this.stopProject(request.params.arguments); - server.js:742-857 (helper)The executeRollCommand() helper method used by stopProject to actually run the 'roll env down' shell command in the project directory.
async executeRollCommand(project_path, rollArgs, description, timeoutMs = 300000, saveToFile = false) { 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( "roll", rollArgs, absoluteProjectPath, timeoutMs, ); const commandStr = `roll ${rollArgs.join(" ")}`; const isSuccess = result.code === 0; // Save output to file only when explicitly requested const logFilePath = saveToFile ? this.saveOutputToFile(result.stdout, result.stderr, commandStr, absoluteProjectPath) : null; let responseText; if (logFilePath) { // Output saved to file const outputPreview = (result.stdout || "").substring(0, 500); const stderrPreview = (result.stderr || "").substring(0, 500); responseText = `${description} ${isSuccess ? "completed successfully" : "failed"}! Command: ${commandStr} Working directory: ${absoluteProjectPath} Exit Code: ${result.code}${result.timedOut ? " (TIMED OUT)" : ""} 📁 Full output saved to file: ${logFilePath} Output Preview (first 500 chars): ${outputPreview || "(no output)"}${(result.stdout || "").length > 500 ? "\n...(truncated)" : ""} Errors Preview (first 500 chars): ${stderrPreview || "(no errors)"}${(result.stderr || "").length > 500 ? "\n...(truncated)" : ""}`; } else { // Return inline output responseText = `${description} ${isSuccess ? "completed successfully" : "failed"}! Command: ${commandStr} Working directory: ${absoluteProjectPath} Exit Code: ${result.code}${result.timedOut ? " (TIMED OUT)" : ""} Output: ${result.stdout || "(no output)"} Errors: ${result.stderr || "(no errors)"}`; } return { content: [ { type: "text", text: responseText, }, ], isError: !isSuccess, }; } catch (error) { const commandStr = `roll ${rollArgs.join(" ")}`; // Save error output to file only when explicitly requested const logFilePath = saveToFile ? this.saveOutputToFile(error.stdout, error.stderr, commandStr, absoluteProjectPath) : null; let responseText; if (logFilePath) { responseText = `Failed to execute command: Command: ${commandStr} Working directory: ${absoluteProjectPath} Error: ${error.message} 📁 Full output saved to file: ${logFilePath}`; } else { responseText = `Failed to execute command: Command: ${commandStr} Working directory: ${absoluteProjectPath} Error: ${error.message} Output: ${error.stdout || "(no output)"} Errors: ${error.stderr || "(no errors)"}`; } return { content: [ { type: "text", text: responseText, }, ], isError: true, }; } }