activate_layout
Enable programmatic activation of Moom window layouts on macOS by specifying the desired layout name through the Moom MCP Server, streamlining workspace management.
Instructions
Activate a specific Moom layout by name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layoutName | Yes | Name of the layout to activate (e.g., "Teaching (Mac Mini)", "AI Research Mode") |
Implementation Reference
- src/index.js:284-311 (handler)The core handler function that executes the 'activate_layout' tool by running AppleScript to instruct the Moom application to apply the specified layout.async activateLayout(layoutName) { // Use AppleScript to apply layout const script = ` tell application "Moom" apply layout "${layoutName}" end tell `; try { await this.runAppleScript(script); return { content: [ { type: 'text', text: `Successfully activated layout: ${layoutName}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error: ${error.message}`, }, ], }; } }
- src/index.js:35-44 (schema)Input schema validation for the tool, requiring a 'layoutName' string parameter.inputSchema: { type: 'object', properties: { layoutName: { type: 'string', description: 'Name of the layout to activate (e.g., "Teaching (Mac Mini)", "AI Research Mode")', }, }, required: ['layoutName'], },
- src/index.js:32-45 (registration)Registration of the 'activate_layout' tool in the ListToolsRequestSchema handler, providing name, description, and schema.{ name: 'activate_layout', description: 'Activate a specific Moom layout by name', inputSchema: { type: 'object', properties: { layoutName: { type: 'string', description: 'Name of the layout to activate (e.g., "Teaching (Mac Mini)", "AI Research Mode")', }, }, required: ['layoutName'], }, },
- src/index.js:209-210 (handler)Dispatch logic in the CallToolRequestSchema handler that routes calls to 'activate_layout' to the activateLayout method.case 'activate_layout': return await this.activateLayout(args.layoutName);