Skip to main content
Glama
LukeLamb

claude-linux-mcp

close_window

Destructive

Close a window on Linux by specifying its title pattern, using the window manager's graceful close hint.

Instructions

Request a window matching the given title pattern to close (gracefully, via the WM close hint).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
title_patternYes

Implementation Reference

  • The 'closeWindow' async function that executes the close_window tool logic. It uses wmctrl -c to send a close request to a window matching the given title_pattern.
    async function closeWindow(args) {
      const missing = requireBin('wmctrl');
      if (missing) return errorResult(missing);
      if (!args.title_pattern) return errorResult('title_pattern is required');
      const r = await run(BIN.wmctrl, ['-c', args.title_pattern]);
      if (r.code !== 0) return errorResult(`close_window failed: ${r.stderr || r.stdout || 'unknown'}`);
      return textResult({ matched: args.title_pattern, close_requested: true });
    }
  • Tool definition and input schema for close_window, specifying title_pattern as a required string input and including a destructiveHint annotation.
    {
      name: 'close_window',
      description: 'Request a window matching the given title pattern to close (gracefully, via the WM close hint).',
      annotations: { title: 'Close window', destructiveHint: true },
      inputSchema: {
        type: 'object',
        properties: { title_pattern: { type: 'string' } },
        required: ['title_pattern'],
      },
    },
  • server.js:558-558 (registration)
    Registration entry mapping the tool name 'close_window' to the closeWindow handler function in the HANDLERS map.
    close_window: closeWindow,
Behavior3/5

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

The description adds behavioral context beyond the annotations by mentioning 'gracefully' and 'via the WM close hint'. However, it does not fully disclose potential consequences (e.g., unsaved changes) or clarify that it is a destructive action beyond the annotation.

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 with no extraneous words. It is front-loaded with the action and efficiently conveys the necessary information.

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 tool with one parameter and no output schema, the description covers the core functionality and parameter meaning. It is complete enough for an agent to use the tool correctly, though additional context about failure modes or preconditions would be helpful.

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?

With schema coverage at 0%, the description adds essential meaning: it specifies that the parameter is a 'title pattern' used for matching, not an exact title. This clarifies usage but could provide examples or pattern syntax.

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 tool's purpose: to request closing a window matching a given title pattern. It uses a specific verb ('close') and resource ('window'), and differentiates from siblings like 'focus_window' and 'list_windows'.

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 on when to use this tool versus alternatives. The description implies graceful closing but does not provide explicit conditions or when-not-to-use scenarios.

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