Skip to main content
Glama
LukeLamb

claude-sessions-mcp

list_windows

Read-only

Retrieve details of all windows in a tmux session, including index, name, active status, and pane count.

Instructions

List windows within a named session (index, name, active flag, pane count).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesSession name.

Implementation Reference

  • The listWindows function that executes the 'list_windows' tool logic. It calls tmux list-windows with a format string and parses the output into structured window data (index, name, active, panes).
    // ─── Tool: list_windows ───────────────────────────────────────────────────
    async function listWindows(args) {
      const missing = requireTmux();
      if (missing) return errorResult(missing);
      const bad = validSessionName(args.name);
      if (bad) return errorResult(bad);
      const fmt = '#{window_index}|#{window_name}|#{window_active}|#{window_panes}';
      const r = await run(BIN.tmux, ['list-windows', '-t', `=${args.name}`, '-F', fmt]);
      if (r.code !== 0) return errorResult(`tmux list-windows failed: ${r.stderr || r.stdout}`);
      const windows = r.stdout.split('\n').filter(Boolean).map((line) => {
        const [index, name, active, panes] = line.split('|');
        return {
          index: parseInt(index, 10),
          name,
          active: active === '1',
          panes: parseInt(panes, 10),
        };
      });
      return textResult({ session: args.name, count: windows.length, windows });
    }
  • The tool registration definition for 'list_windows', including its description, annotations, and inputSchema (requires 'name' string).
    {
      name: 'list_windows',
      description: 'List windows within a named session (index, name, active flag, pane count).',
      annotations: { title: 'List session windows', readOnlyHint: true, destructiveHint: false, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          name: { type: 'string', description: 'Session name.' },
        },
        required: ['name'],
        additionalProperties: false,
      },
    },
  • server.js:329-329 (registration)
    Mapping of 'list_windows' tool name to the listWindows handler function in the HANDLERS dispatch table.
    list_windows: listWindows,
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the description adds the return fields (index, name, active flag, pane count). However, it does not disclose behavior if the session does not exist or any other edge cases. Adds some context but not 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?

The description is a single, concise sentence (12 words) with no wasted words. It is front-loaded with the action 'List windows' and immediately clarifies scope and return fields.

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?

For a simple read-only list tool with 1 parameter and no output schema, the description is fairly complete: it specifies what it does, what it returns, and the required input. It could mention that the session must exist, but that is implied. Sibling tools provide additional context.

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 coverage is 100% (the only parameter 'name' is described as 'Session name'). The description reinforces that the session is named but adds no new semantic meaning beyond the schema. Baseline 3 for high 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 verb 'List' and the resource 'windows within a named session', and specifies return fields (index, name, active flag, pane count). This distinguishes it from sibling tools like list_sessions (list sessions) and capture_pane (capture pane output).

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

Usage Guidelines3/5

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

The description implies usage when you have a session name and want to see its windows, but does not explicitly state when to use this tool versus alternatives like list_sessions or when not to use it. No guidance on prerequisites (e.g., session must exist).

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/LukeLamb/claude-sessions-mcp'

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