Skip to main content
Glama

kill

Stop one or more AI agents managed by the cmuxlayer terminal multiplexer. Specify agent IDs or use 'all' to terminate agents, with optional force kill capability.

Instructions

Stop one or more agents. Target can be a single agent ID, an array of IDs, or 'all'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesAgent ID, array of agent IDs, or 'all' to stop all agents
forceNoForce kill (SIGKILL) instead of graceful (Ctrl+C)

Implementation Reference

  • Implementation of the 'kill' MCP tool, which stops agents either gracefully or forcibly.
    server.tool(
      "kill",
      "Stop one or more agents. Target can be a single agent ID, an array of IDs, or 'all'.",
      {
        target: z
          .union([z.string(), z.array(z.string())])
          .describe(
            "Agent ID, array of agent IDs, or 'all' to stop all agents",
          ),
        force: z
          .boolean()
          .optional()
          .default(false)
          .describe("Force kill (SIGKILL) instead of graceful (Ctrl+C)"),
      },
      async (args) => {
        try {
          const killed: string[] = [];
          const errors: string[] = [];
    
          // Resolve target list
          let targetIds: string[];
          if (args.target === "all") {
            const agents = engine.listAgents();
            targetIds = agents
              .filter((a) => a.state !== "done" && a.state !== "error")
              .map((a) => a.agent_id);
          } else if (Array.isArray(args.target)) {
            targetIds = args.target;
          } else {
            targetIds = [args.target];
          }
    
          if (targetIds.length === 0) {
            return ok({ killed: [], message: "No agents to kill" });
          }
    
          // Kill each agent, collecting results
          for (const agentId of targetIds) {
            try {
              await engine.stopAgent(agentId, args.force);
              killed.push(agentId);
            } catch (e) {
              errors.push(
                `${agentId}: ${e instanceof Error ? e.message : String(e)}`,
              );
            }
          }
    
          if (killed.length === 0 && errors.length > 0) {
            return err(
              new Error(`Failed to kill any agents: ${errors.join("; ")}`),
            );
          }
    
          return ok({
            killed,
            errors: errors.length > 0 ? errors : undefined,
            force: args.force,
Behavior3/5

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

With no annotations, the description carries full burden. It discloses the action ('Stop') and target flexibility, but doesn't mention side effects (e.g., agent termination consequences), permissions needed, or error handling. It adds basic context but lacks rich behavioral details.

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?

Single sentence, front-loaded with core action, zero waste. Every word earns its place by specifying target options concisely.

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

Completeness3/5

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

Given no annotations and no output schema, the description is minimal but adequate for a destructive tool with good schema coverage. It covers the what but lacks details on outcomes, errors, or prerequisites, leaving gaps in completeness.

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 both parameters thoroughly. The description adds no additional meaning beyond what's in the schema (e.g., no extra syntax or format details). Baseline 3 is appropriate when schema does the heavy lifting.

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?

The description clearly states the verb ('Stop') and resource ('one or more agents'), distinguishing it from siblings like 'stop_agent' by specifying it can handle multiple targets including 'all'. It's specific and unambiguous.

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

Usage Guidelines4/5

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

The description implies usage by specifying target types (single ID, array, or 'all'), but doesn't explicitly state when to use this vs. 'stop_agent' or other alternatives. It provides clear context but lacks explicit exclusions or comparisons.

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/EtanHey/cmuxlayer'

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