Skip to main content
Glama

start_process

Launch and monitor long-running terminal processes while capturing output to log files for tracking and analysis.

Instructions

Start a long-running process and capture its output to a log file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUnique process identifier
commandYesCommand to execute
cwdNoWorking directory (optional)

Implementation Reference

  • The implementation of the start_process handler in ProcessManager.
    async startProcess(input: StartProcessInput): Promise<{ id: string; status: 'started' }> {
      if (!input.command || input.command.trim() === '') {
        throw new Error('Command is required');
      }
    
      if (this.processes.has(input.id)) {
        throw new Error(`Process '${input.id}' is already running`);
      }
    
      const logFile = path.join(this.logService.logsDir, `${input.id}.log`);
    
      const childProcess = spawn(input.command, [], {
        shell: true,
        cwd: input.cwd || process.cwd(),
        stdio: ['ignore', 'pipe', 'pipe'],
      });
    
      // Stream stdout and stderr to log file
      childProcess.stdout?.on('data', (data) => {
        this.logService.appendLog(logFile, data.toString());
      });
    
      childProcess.stderr?.on('data', (data) => {
        this.logService.appendLog(logFile, data.toString());
      });
    
      this.processes.set(input.id, {
        id: input.id,
        process: childProcess,
        logFile,
        status: 'running',
      });
    
      // Store log file path for retrieval after process exits
      this.logFiles.set(input.id, logFile);
    
      // Auto-cleanup when process exits naturally
      childProcess.on('exit', () => {
        this.processes.delete(input.id);
      });
    
      return { id: input.id, status: 'started' };
    }
  • src/index.ts:94-97 (registration)
    The tool execution logic routing in the MCP request handler.
    case 'start_process': {
      const result = await processManager.startProcess(args as any);
      return { content: [{ type: 'text', text: JSON.stringify(result) }] };
    }
  • src/index.ts:28-41 (registration)
    The tool registration details for start_process.
    {
      name: 'start_process',
      description: 'Start a long-running process and capture its output to a log file',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'string', description: 'Unique process identifier' },
          command: { type: 'string', description: 'Command to execute' },
          cwd: { type: 'string', description: 'Working directory (optional)' },
        },
        required: ['id', 'command'],
      },
    },
    {
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the process is 'long-running' and output is captured to a log file, but fails to address critical aspects like permissions required, whether the process runs asynchronously, how errors are handled, or if there are rate limits. This leaves significant gaps for safe and effective tool invocation.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and outcome, making it easy to understand at a glance.

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 complexity of starting a process (which involves execution, logging, and potential side-effects) and the absence of annotations and output schema, the description is insufficient. It does not explain what the tool returns (e.g., process status, log file path), error conditions, or interaction with sibling tools like 'get_logs', leaving the agent with incomplete operational context.

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 parameters (id, command, cwd). The description does not add any additional meaning or context beyond what the schema provides, such as examples of valid commands or log file naming conventions. Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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 action ('Start a long-running process') and the outcome ('capture its output to a log file'), which is specific and actionable. However, it does not explicitly differentiate from sibling tools like 'stop_process' or 'list_processes', which would require mentioning process lifecycle management or monitoring aspects.

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 such as 'stop_process' or 'get_logs'. It lacks context about prerequisites, error handling, or typical use cases, leaving the agent to infer usage from the tool name alone.

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/h004888/mcp_terminal_process'

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