Skip to main content
Glama
FutureAtoms

Agentic Control Framework (ACF)

by FutureAtoms

kill_process

Terminate a running process by providing its process ID (PID). Useful for stopping unresponsive or unwanted programs.

Instructions

Kill process

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYes

Implementation Reference

  • The actual handler function `killProcess(pid)` that validates the PID, prevents killing critical system processes (0, 1, own PID), uses treeKill on Windows or SIGTERM/SIGKILL on POSIX, and returns success/error messages.
    async function killProcess(pid) {
      try {
        // Validate PID
        if (!pid || isNaN(pid)) {
          return {
            success: false,
            message: 'Invalid PID provided'
          };
        }
    
        // Don't allow killing critical system processes
        const criticalPids = [0, 1, process.pid];
        if (criticalPids.includes(pid)) {
          return {
            success: false,
            message: 'Cannot kill critical system process'
          };
        }
    
        if (process.platform === 'win32') {
          await new Promise((resolve, reject) => {
            treeKill(pid, undefined, (err) => (err ? reject(err) : resolve()));
          });
        } else {
          // POSIX signals
          process.kill(pid, 'SIGTERM');
          await new Promise(resolve => setTimeout(resolve, 100));
          try {
            process.kill(pid, 0); // still running
            process.kill(pid, 'SIGKILL');
          } catch (_) {
            // already exited
          }
        }
    
        return {
          success: true,
          message: `Process ${pid} terminated successfully`,
          pid
        };
    
      } catch (error) {
        if (error.code === 'ESRCH') {
          return {
            success: false,
            message: `Process ${pid} not found`
          };
        } else if (error.code === 'EPERM') {
          return {
            success: false,
            message: `Permission denied to kill process ${pid}`
          };
        }
    
        logger.error(`Error killing process: ${error.message}`);
        return {
          success: false,
          message: error.message
        };
      }
    }
  • Input schema registration for 'kill_process': defines the tool name, description ('Kill process'), and input schema requiring a numeric 'pid'.
    { name:'kill_process', description:'Kill process', inputSchema:{ type:'object', properties:{ pid:{type:'number'} }, required:['pid'] } },
  • Dispatch/registration of the tool in the MCP server's request handler: routes 'kill_process' to `terminalTools.killProcess(args.pid)`.
    case 'kill_process': data = await terminalTools.killProcess(args.pid); break;
  • Required dependency: `tree-kill` library imported for cross-platform process termination.
    const treeKill = require('tree-kill');
  • Module export of `killProcess` as part of the public API of terminal_tools.
    module.exports = {
      getConfig,
      setConfigValue,
      executeCommand,
      readOutput,
      forceTerminate,
      listSessions,
      listProcesses,
      killProcess
Behavior1/5

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

No annotations are present, so the description must disclose behavioral traits. It only says 'kill', omitting details on the termination signal (e.g., SIGTERM vs SIGKILL), potential side effects (e.g., data loss), or whether it is reversible. The tool could be destructive, but this is not clarified.

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

Conciseness2/5

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

The description is extremely short (two words), but conciseness should not come at the cost of meaning. It fails to convey essential information, making it under-specified rather than efficiently clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and no output schema, the description should at minimum explain the action, parameter meaning, and return behavior. It does none of these, leaving the agent with insufficient context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must explain the 'pid' parameter. It does not, leaving the agent to guess that pid is a process ID, without format or range constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Kill process' is a tautology that merely restates the tool name without providing any additional specificity, such as what types of processes it applies to (e.g., system vs user, local vs remote) or any distinguishing features from siblings like 'force_terminate'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'force_terminate' or 'execute_command' with kill signals. The description lacks context about prerequisites (e.g., permissions) or scenarios.

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/FutureAtoms/agentic-control-framework'

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