Skip to main content
Glama
itrimble

Moom MCP Server

by itrimble

set_window_position

Move application windows to exact screen coordinates for precise positioning control in macOS window management.

Instructions

Move a window to a specific position for precise control

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appNameYesName of the application
xYesX coordinate
yYesY coordinate

Implementation Reference

  • The handler function that executes the set_window_position tool. It constructs and runs an AppleScript to activate the specified application and set the position of its front window to the given (x, y) coordinates.
    async setWindowPosition(appName, x, y) {
      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 position of front window to {${x}, ${y}}
          end tell
        end tell
      `;
    
      try {
        await this.runAppleScript(script);
        return {
          content: [{
            type: 'text',
            text: `Successfully positioned ${appName} window at (${x}, ${y})`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error positioning ${appName}: ${error.message}`
          }]
        };
      }
  • Defines the input schema for the set_window_position tool, specifying required parameters appName (string), x (number), and y (number).
    inputSchema: {
      type: 'object',
      properties: {
        appName: {
          type: 'string',
          description: 'Name of the application',
        },
        x: {
          type: 'number',
          description: 'X coordinate',
        },
        y: {
          type: 'number',
          description: 'Y coordinate',
        },
      },
      required: ['appName', 'x', 'y'],
    },
  • src/index.js:229-230 (registration)
    Registers the tool handler in the CallToolRequestSchema switch statement, dispatching to the setWindowPosition method.
    case 'set_window_position':
      return await this.setWindowPosition(args.appName, args.x, args.y);
  • src/index.js:158-179 (registration)
    Registers the tool in the ListToolsRequestSchema response, providing name, description, and input schema.
    {
      name: 'set_window_position',
      description: 'Move a window to a specific position for precise control',
      inputSchema: {
        type: 'object',
        properties: {
          appName: {
            type: 'string',
            description: 'Name of the application',
          },
          x: {
            type: 'number',
            description: 'X coordinate',
          },
          y: {
            type: 'number',
            description: 'Y coordinate',
          },
        },
        required: ['appName', 'x', 'y'],
      },
    },
  • Helper function to map application names to their process names, used in setWindowPosition to target the correct System Events process.
    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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool moves a window, implying a mutation operation, but doesn't disclose critical traits: whether it requires specific permissions, if changes are reversible, potential side effects (e.g., window focus changes), or error conditions (e.g., invalid coordinates). The phrase 'for precise control' hints at manual adjustment but lacks operational 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, efficient sentence that front-loads the core action ('Move a window') and purpose ('for precise control'). There is no wasted language, repetition, or unnecessary elaboration. It's appropriately sized for a tool with three parameters and clear schema coverage, earning its place without verbosity.

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 the tool's complexity (a mutation operation with positional parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like success/failure responses, coordinate boundaries, or interaction with sibling tools (e.g., how it differs from layout-based tools). For a window management tool with potential side effects, more context on usage and outcomes is needed.

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%, with clear parameter descriptions in the schema (e.g., 'X coordinate'). The description adds minimal value beyond the schema, mentioning 'specific position' which aligns with the x and y parameters but doesn't explain coordinate systems, units, or how 'appName' identifies the target window. Baseline 3 is appropriate as the schema does the heavy lifting, but the description doesn't compensate with additional insights.

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 ('Move a window') and the resource ('a window'), specifying the purpose as positioning for precise control. It distinguishes from sibling tools like 'set_window_size' (which handles dimensions) and 'activate_layout' (which applies predefined layouts), but doesn't explicitly name these alternatives. The verb+resource combination is specific, though it could be more precise about what 'position' entails.

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., needing an active window), exclusions (e.g., not working with minimized windows), or comparisons to siblings like 'create_custom_grid_layout' for structured positioning or 'trigger_moom_action' for automated window management. Usage is implied only by the tool's name and description, lacking explicit context.

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