Skip to main content
Glama

tmux_list_sessions

View active tmux sessions with details like name, windows, creation time, and attachment status to manage terminal workflows.

Instructions

List all active tmux sessions with their details (name, windows, created time, attached status).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the tmux list-sessions command using execAsync, parses the output into structured session data (name, windows, created time, attached status), and returns it as JSON text content.
    async listSessions() {
      try {
        const { stdout } = await execAsync(
          "tmux list-sessions -F '#{session_name}|#{session_windows}|#{session_created}|#{session_attached}' 2>/dev/null || echo ''"
        );
    
        if (!stdout.trim()) {
          return {
            content: [
              {
                type: "text",
                text: "No active tmux sessions",
              },
            ],
          };
        }
    
        const sessions = stdout
          .trim()
          .split("\n")
          .map((line) => {
            const [name, windows, created, attached] = line.split("|");
            const createdDate = new Date(parseInt(created) * 1000);
            return {
              name,
              windows: parseInt(windows),
              created: createdDate.toISOString(),
              attached: attached === "1",
            };
          });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(sessions, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new Error(`Failed to list sessions: ${error.message}`);
      }
    }
  • Defines the tool name, description, and empty input schema for tmux_list_sessions in the list of tools.
    {
      name: "tmux_list_sessions",
      description:
        "List all active tmux sessions with their details (name, windows, created time, attached status).",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.js:193-194 (registration)
    Registers the handler dispatch for tmux_list_sessions in the CallToolRequest switch statement.
    case "tmux_list_sessions":
      return await this.listSessions();
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It describes the output details (name, windows, created time, attached status), which adds behavioral context beyond the schema. However, it lacks information on potential errors, rate limits, or authentication needs.

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 front-loads the purpose and details without any wasted words. Every part of the sentence contributes directly to understanding the tool.

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

Completeness4/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is complete enough for a listing operation. It specifies what details are returned, though it could benefit from mentioning output format or error handling for higher completeness.

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

Parameters4/5

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

There are 0 parameters, and schema description coverage is 100%, so no parameter information is needed. The description appropriately focuses on the tool's purpose and output, earning a baseline score of 4 for this dimension.

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 ('List') and resource ('all active tmux sessions'), specifying the exact details returned (name, windows, created time, attached status). It distinguishes from siblings like tmux_create_session (creation) and tmux_kill_session (deletion) by focusing on read-only listing.

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 for viewing active sessions, but does not explicitly state when to use this versus alternatives like tmux_list_panes (which lists panes within sessions) or provide exclusions. However, the context is clear for a listing operation.

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

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