Skip to main content
Glama

set_window_size

Resize application windows to specific dimensions by specifying app name, width, and height using the Moom MCP Server for macOS.

Instructions

Resize a window to specific dimensions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appNameYesName of the application
heightYesWindow height
widthYesWindow width

Implementation Reference

  • The handler function that executes the window resizing logic using AppleScript to set the front window size via System Events.
    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}` }] }; } }
  • Input schema definition for the set_window_size tool in the listTools response.
    { 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)
    Registration of the set_window_size tool handler in the CallToolRequest switch statement.
    case 'set_window_size': return await this.setWindowSize(args.appName, args.width, args.height);
  • Helper function to map application names to System Events process names, used by setWindowSize.
    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; }

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