save_current_layout
Capture and store your current window arrangement as a new Moom layout for macOS, enabling quick restoration. Specify a unique layoutName to organize your desktop configurations efficiently.
Instructions
Save the current window arrangement as a new Moom layout
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layoutName | Yes | Name for the new layout |
Implementation Reference
- src/index.js:313-341 (handler)The core handler function for the 'save_current_layout' tool. It constructs and executes an AppleScript command to save the current window arrangement as a new Moom layout with the specified name, returning success or error message.async saveCurrentLayout(layoutName) { // Use AppleScript to save layout const script = ` tell application "Moom" save layout and replace "${layoutName}" end tell `; try { await this.runAppleScript(script); return { content: [ { type: 'text', text: `Successfully saved layout: ${layoutName}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error saving layout: ${error.message}`, }, ], }; } }
- src/index.js:46-58 (registration)Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema.{ name: 'save_current_layout', description: 'Save the current window arrangement as a new Moom layout', inputSchema: { type: 'object', properties: { layoutName: { type: 'string', description: 'Name for the new layout', }, }, required: ['layoutName'], }, },
- src/index.js:49-58 (schema)Input schema definition for the tool, specifying the required 'layoutName' parameter.inputSchema: { type: 'object', properties: { layoutName: { type: 'string', description: 'Name for the new layout', }, }, required: ['layoutName'], }, },
- src/index.js:211-212 (handler)Dispatcher case in CallToolRequestSchema handler that routes the tool call to the saveCurrentLayout method.case 'save_current_layout': return await this.saveCurrentLayout(args.layoutName);