Skip to main content
Glama
nickgnd

Tmux MCP Server

by nickgnd

kill-window

Terminate a tmux window by specifying its ID to remove unwanted terminal sessions and manage workspace organization.

Instructions

Kill a tmux window by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowIdYesID of the tmux window to kill

Implementation Reference

  • src/index.ts:259-284 (registration)
    Registration of the 'kill-window' MCP tool, including schema, description, and inline handler function that delegates to tmux.killWindow
    server.tool(
      "kill-window",
      "Kill a tmux window by ID",
      {
        windowId: z.string().describe("ID of the tmux window to kill")
      },
      async ({ windowId }) => {
        try {
          await tmux.killWindow(windowId);
          return {
            content: [{
              type: "text",
              text: `Window ${windowId} has been killed`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: `Error killing window: ${error}`
            }],
            isError: true
          };
        }
      }
    );
  • Helper function killWindow that executes the underlying tmux 'kill-window' command via executeTmux
    export async function killWindow(windowId: string): Promise<void> {
      await executeTmux(`kill-window -t '${windowId}'`);
    }
  • Inline handler function for the kill-window tool
    async ({ windowId }) => {
      try {
        await tmux.killWindow(windowId);
        return {
          content: [{
            type: "text",
            text: `Window ${windowId} has been killed`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: `Error killing window: ${error}`
          }],
          isError: true
        };
      }
    }
  • Input schema defining the windowId parameter for the tool
    {
      windowId: z.string().describe("ID of the tmux window to kill")
    },
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 action ('Kill') which implies destructive behavior, but doesn't clarify if this is reversible, what permissions are needed, or what happens to panes within the window. Significant behavioral details are missing.

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 with zero wasted words. It's appropriately sized for a simple tool and front-loads the essential information immediately.

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 insufficient. It doesn't explain what 'kill' entails behaviorally, what happens to contained panes, or what the tool returns. Given the complexity of a destructive operation, more context is needed.

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 the single parameter. The description adds no additional meaning beyond what the schema provides about the windowId parameter, meeting the baseline for high schema coverage.

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 specific action ('Kill') and target resource ('a tmux window by ID'), distinguishing it from sibling tools like kill-session or kill-pane. It precisely communicates what the tool does without ambiguity.

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 is provided on when to use this tool versus alternatives like kill-session or kill-pane. The description states what it does but offers no context about appropriate scenarios or prerequisites for use.

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