Skip to main content
Glama
nickgnd

Tmux MCP Server

by nickgnd

kill-session

Terminate a tmux session by its ID to free system resources and manage terminal sessions effectively.

Instructions

Kill a tmux session by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesID of the tmux session to kill

Implementation Reference

  • MCP tool handler function for "kill-session". Takes sessionId, calls tmux.killSession, returns success or error message.
    async ({ sessionId }) => {
      try {
        await tmux.killSession(sessionId);
        return {
          content: [{
            type: "text",
            text: `Session ${sessionId} has been killed`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: `Error killing session: ${error}`
          }],
          isError: true
        };
      }
    }
  • Input schema for kill-session tool using Zod: requires sessionId as string.
    {
      sessionId: z.string().describe("ID of the tmux session to kill")
    },
  • src/index.ts:231-256 (registration)
    Registration of the "kill-session" tool on the MCP server with name, description, schema, and handler.
    server.tool(
      "kill-session",
      "Kill a tmux session by ID",
      {
        sessionId: z.string().describe("ID of the tmux session to kill")
      },
      async ({ sessionId }) => {
        try {
          await tmux.killSession(sessionId);
          return {
            content: [{
              type: "text",
              text: `Session ${sessionId} has been killed`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: `Error killing session: ${error}`
            }],
            isError: true
          };
        }
      }
    );
  • Helper function killSession that executes the tmux 'kill-session' command via executeTmux.
    export async function killSession(sessionId: string): Promise<void> {
      await executeTmux(`kill-session -t '${sessionId}'`);
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool kills a session but doesn't clarify if this action is destructive, irreversible, requires specific permissions, or what happens to associated panes/windows. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 extremely concise at just six words, front-loading the essential information with zero wasted language. Every word earns its place by specifying the action, target, and identification method efficiently.

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 destructive tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address what 'kill' entails behaviorally, what happens to session contents, whether confirmation is needed, or what the tool returns. The context demands more disclosure for safe usage.

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?

The schema description coverage is 100%, with the single parameter 'sessionId' fully documented in the schema. The description doesn't add any additional parameter semantics beyond what's already in the schema, so it meets the baseline score of 3 where the schema handles the heavy lifting.

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 ('kill') and target resource ('tmux session by ID'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from similar sibling tools like 'kill-pane' or 'kill-window', which would require specifying it terminates entire sessions rather than individual components.

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 like 'kill-pane' or 'kill-window', nor does it mention prerequisites such as needing an existing session ID. It simply states what the tool does without contextual usage information.

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/nickgnd/tmux-mcp'

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