Skip to main content
Glama
itrimble

Moom MCP Server

by itrimble

set_window_size

Resize application windows to precise dimensions on macOS by specifying width and height values for programmatic layout control.

Instructions

Resize a window to specific dimensions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appNameYesName of the application
widthYesWindow width
heightYesWindow height

Implementation Reference

  • The main handler function for the set_window_size tool. It activates the specified application, brings its front window to the foreground, and uses AppleScript via System Events to resize the window to the given width and height.
    async setWindowSize(appName, width, height) {
      const processName = this.getProcessName(appName);
      const script = `
        tell application "${appName}" to activate
        delay 0.5
        tell application "System Events"
          tell process "${processName}"
            set frontmost to true
            set size of front window to {${width}, ${height}}
          end tell
        end tell
      `;
    
      try {
        await this.runAppleScript(script);
        return {
          content: [{
            type: 'text',
            text: `Successfully resized ${appName} window to ${width}x${height}`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error resizing ${appName}: ${error.message}`
          }]
        };
      }
    }
  • The input schema definition for the set_window_size tool, specifying appName, width, and height as required parameters.
    {
      name: 'set_window_size',
      description: 'Resize a window to specific dimensions',
      inputSchema: {
        type: 'object',
        properties: {
          appName: {
            type: 'string',
            description: 'Name of the application',
          },
          width: {
            type: 'number',
            description: 'Window width',
          },
          height: {
            type: 'number',
            description: 'Window height',
          },
        },
        required: ['appName', 'width', 'height'],
      },
    },
  • src/index.js:231-232 (registration)
    The dispatch case in the CallToolRequestSchema handler that routes calls to the setWindowSize method.
    case 'set_window_size':
      return await this.setWindowSize(args.appName, args.width, args.height);
  • Helper function used by setWindowSize to map application names to their process names for AppleScript.
    getProcessName(appName) {
      const processMap = {
        "Visual Studio Code": "Code",
        "iTerm": "iTerm2",
        "Safari": "Safari",
        "Claude": "Claude",
        "Terminal": "Terminal",
        "Finder": "Finder",
        "Chrome": "Google Chrome",
        "Firefox": "Firefox"
      };
      return processMap[appName] || appName;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action ('Resize') but doesn't disclose behavioral traits such as whether it requires specific permissions, if it works on minimized windows, what happens with invalid dimensions, or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 waste. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place without redundancy or unnecessary elaboration.

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?

Given this is a mutation tool with no annotations, no output schema, and 3 parameters, the description is incomplete. It lacks information on behavioral context (e.g., side effects, error handling), usage guidelines, and what to expect upon success. For a tool that modifies window states, more completeness is needed to guide effective use.

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 all three parameters (appName, width, height) with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as units for dimensions or examples of appName values. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Resize') and target resource ('a window') with specific dimensions. It distinguishes from sibling tools like 'set_window_position' (which moves rather than resizes) and 'activate_layout' (which applies predefined layouts). However, it doesn't explicitly mention how it differs from layout-related siblings like 'create_custom_grid_layout'.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., whether the application must be running), when not to use it (e.g., for system windows), or direct alternatives among siblings like 'create_custom_grid_layout' for predefined sizes. Usage is implied but not explicitly stated.

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/itrimble/moom-mcp'

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