Skip to main content
Glama
dockergiant

RollDev MCP Server

by dockergiant

rolldev_stop_svc

Stop RollDev system services for a specified project directory to halt development environments.

Instructions

Stop RollDev system services

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYesPath to the project directory

Implementation Reference

  • Handler function for rolldev_stop_svc - executes 'roll svc down' command via executeRollCommand helper.
    async stopSvc(args) {
      const { project_path } = args;
      return await this.executeRollCommand(
        project_path,
        ["svc", "down"],
        "Stopping RollDev system services",
      );
    }
  • server.js:142-154 (registration)
    Tool registration: defines name 'rolldev_stop_svc', description 'Stop RollDev system services', and inputSchema with required project_path string.
      name: "rolldev_stop_svc",
      description: "Stop RollDev system services",
      inputSchema: {
        type: "object",
        properties: {
          project_path: {
            type: "string",
            description: "Path to the project directory",
          },
        },
        required: ["project_path"],
      },
    },
  • server.js:303-304 (registration)
    Switch case routing the tool name 'rolldev_stop_svc' to stopSvc handler.
    case "rolldev_stop_svc":
      return await this.stopSvc(request.params.arguments);
  • executeRollCommand helper - executes a 'roll' CLI command with args, handles success/failure, returns formatted text response.
      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,
          };
        }
      }
  • executeCommand helper - spawns a child process, collects stdout/stderr, handles timeouts with SIGTERM/SIGKILL.
    executeCommand(command, args = [], cwd = process.cwd(), timeoutMs = 300000) {
      return new Promise((resolve, reject) => {
        const childProcess = spawn(command, args, {
          cwd,
          stdio: ["pipe", "pipe", "pipe"],
        });
    
        let stdout = "";
        let stderr = "";
        let resolved = false;
    
        // Helper to resolve only once
        const resolveOnce = (result) => {
          if (!resolved) {
            resolved = true;
            clearTimeout(timeout);
            resolve(result);
          }
        };
    
        const rejectOnce = (error) => {
          if (!resolved) {
            resolved = true;
            clearTimeout(timeout);
            reject(error);
          }
        };
    
        // Timeout handler
        const timeout = setTimeout(() => {
          if (!resolved) {
            // Try graceful termination first
            childProcess.kill('SIGTERM');
    
            // Force kill after 5 seconds if still running
            setTimeout(() => {
              if (!resolved) {
                childProcess.kill('SIGKILL');
              }
            }, 5000);
    
            resolveOnce({
              stdout,
              stderr: stderr + `\n[Command timed out after ${timeoutMs / 1000}s]`,
              code: -1,
              timedOut: true,
            });
          }
        }, timeoutMs);
    
        childProcess.stdout.on("data", (data) => {
          stdout += data.toString();
        });
    
        childProcess.stderr.on("data", (data) => {
          stderr += data.toString();
        });
    
        childProcess.on("close", (code) => {
          resolveOnce({ stdout, stderr, code });
        });
    
        // Also listen to 'exit' as backup (some processes emit exit but not close)
        childProcess.on("exit", (code) => {
          resolveOnce({ stdout, stderr, code });
        });
    
        childProcess.on("error", (error) => {
          const enhancedError = new Error(
            `Failed to spawn command: ${error.message}`,
          );
          enhancedError.stdout = stdout;
          enhancedError.stderr = stderr;
          rejectOnce(enhancedError);
        });
      });
Behavior2/5

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

No annotations provided; description only says 'stop' without detailing side effects, what services are affected, or whether it's destructive. Lacks clarity on behavior beyond the obvious.

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

Conciseness3/5

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

Extremely brief (one phrase), but concise. No wasted words, yet lacks detail that could improve usability without making it longer.

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?

For a simple tool, description is minimal; missing usage context and behavioral details. Agent may not know when to invoke or what consequences to expect.

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 coverage is 100% (one parameter described). Description does not add extra meaning beyond the schema field 'Path to the project directory', so baseline 3 applies.

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?

Description clearly states it stops RollDev system services, differentiating from siblings like rolldev_stop_project. Verb 'stop' and resource 'RollDev system services' are specific.

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?

No guidance on when to use this tool vs alternatives. Does not mention prerequisites or typical usage sequence with other tools like rolldev_start_svc.

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/dockergiant/rolldev-mcp-server'

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