Skip to main content
Glama
LukeLamb

claude-linux-mcp

list_windows

Read-only

List all visible windows with detailed properties such as ID, PID, desktop, geometry, hostname, and title for window management and automation.

Instructions

List all visible windows with id, pid, desktop, geometry (x/y/width/height), hostname, and title.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'list_windows' tool. It requires 'wmctrl', executes 'wmctrl -l -G -p' to list all visible windows, parses the output into structured objects (id, desktop, pid, x, y, width, height, host, title), and returns the result as text.
    async function listWindows() {
      const missing = requireBin('wmctrl');
      if (missing) return errorResult(missing);
      const r = await run(BIN.wmctrl, ['-l', '-G', '-p']);
      if (r.code !== 0) return errorResult(`wmctrl failed: ${r.stderr || r.stdout}`);
      const entries = r.stdout.split('\n').filter(Boolean).map((line) => {
        // Format: <id> <desktop> <pid> <x> <y> <width> <height> <host> <title...>
        const parts = line.split(/\s+/);
        if (parts.length < 9) return null;
        const [id, desktop, pid, x, y, w, h, host, ...titleParts] = parts;
        return {
          id,
          desktop: parseInt(desktop, 10),
          pid: parseInt(pid, 10),
          x: parseInt(x, 10),
          y: parseInt(y, 10),
          width: parseInt(w, 10),
          height: parseInt(h, 10),
          host,
          title: titleParts.join(' '),
        };
      }).filter(Boolean);
      return textResult({ windows: entries });
    }
  • Tool registration object defining the 'list_windows' schema: name, description (lists visible windows with geometry/metadata), annotations (title, readOnlyHint), and an empty inputSchema (no required parameters).
    {
      name: 'list_windows',
      description: 'List all visible windows with id, pid, desktop, geometry (x/y/width/height), hostname, and title.',
      annotations: { title: 'List windows', readOnlyHint: true },
      inputSchema: { type: 'object', properties: {} },
    },
  • server.js:553-555 (registration)
    The HANDLERS map that wires the tool name 'list_windows' to the listWindows handler function for dispatching.
    const HANDLERS = {
      screenshot,
      list_windows: listWindows,
Behavior3/5

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

The description specifies the output fields beyond the readOnlyHint annotation, which already marks it as safe. However, it does not disclose additional behavioral traits like whether visible windows are limited to the current host, ordering, or performance implications. The annotation covers the safety aspect, so the description adds moderate value.

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, information-dense sentence that directly states the tool's purpose and deliverables. It is front-loaded with the verb 'List' and avoids any extraneous words.

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 parameterless list operation, the description adequately covers the action and the output details. It could be slightly stronger if it clarified the scope (e.g., current display, local machine). However, given no output schema, the description is complete enough for an AI agent to understand the tool's value.

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?

The input schema has zero parameters, so the description does not need to explain param meaning. By default, a tool with no parameters gets a baseline score of 4.

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 explicitly states the verb 'List' and the resource 'visible windows', and enumerates the fields returned (id, pid, desktop, geometry, title, etc.). This clearly differentiates from sibling tools like close_window, focus_window, or move_window, which perform distinct actions.

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 such as focus_window or close_window. There is no advice on prerequisites, nor on when not to use it, leaving the agent to infer context from the tool's name alone.

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-linux-mcp'

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