Skip to main content
Glama
itrimble

Moom MCP Server

by itrimble

create_quad_layout

Arrange four applications in a 2x2 grid layout on a specified display using the Moom MCP Server for macOS window management.

Instructions

Create a quad (2x2) window layout on a specific display

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layoutNameYesName for the quad layout
displayNoWhich display to use
appsYesArray of 4 app names for TL, TR, BL, BR positions

Implementation Reference

  • The handler function that executes the tool logic: validates 4 apps, uses AppleScript with Moom shortcuts to position apps in TL/TR/BL/BR quadrants, and saves the layout.
    async createQuadLayout(layoutName, display = 'main', apps) {
      if (apps.length !== 4) {
        return {
          content: [{
            type: 'text',
            text: 'Error: Quad layout requires exactly 4 apps'
          }]
        };
      }
    
      const script = `
        -- Rectangle shortcuts for quarters
        on topLeft()
          tell application "System Events"
            key code 32 using {control down, command down} -- U
          end tell
        end topLeft
        
        on topRight()
          tell application "System Events"
            key code 34 using {control down, command down} -- I
          end tell
        end topRight
        
        on bottomLeft()
          tell application "System Events"
            key code 38 using {control down, command down} -- J
          end tell
        end bottomLeft
        
        on bottomRight()
          tell application "System Events"
            key code 40 using {control down, command down} -- K
          end tell
        end bottomRight
        
        -- Position apps in quarters
        tell application "${apps[0]}" to activate
        delay 0.5
        topLeft()
        delay 0.5
        
        tell application "${apps[1]}" to activate
        delay 0.5
        topRight()
        delay 0.5
        
        tell application "${apps[2]}" to activate
        delay 0.5
        bottomLeft()
        delay 0.5
        
        tell application "${apps[3]}" to activate
        delay 0.5
        bottomRight()
        delay 0.5
        
        -- Save as Moom layout
        tell application "Moom"
          save layout and replace "${layoutName}"
        end tell
      `;
    
      try {
        await this.runAppleScript(script);
        return {
          content: [{
            type: 'text',
            text: `Successfully created quad layout: ${layoutName}`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error creating quad layout: ${error.message}`
          }]
        };
      }
    }
  • Input schema definition specifying parameters: layoutName (required), display (optional), apps (array of 4 strings, required).
    {
      name: 'create_quad_layout',
      description: 'Create a quad (2x2) window layout on a specific display',
      inputSchema: {
        type: 'object',
        properties: {
          layoutName: {
            type: 'string',
            description: 'Name for the quad layout',
          },
          display: {
            type: 'string',
            enum: ['main', 'left', 'right'],
            description: 'Which display to use',
          },
          apps: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of 4 app names for TL, TR, BL, BR positions',
          },
        },
        required: ['layoutName', 'apps'],
      },
    },
  • src/index.js:219-220 (registration)
    Switch case in CallToolRequest handler that routes the tool call to the createQuadLayout method.
    case 'create_quad_layout':
      return await this.createQuadLayout(args.layoutName, args.display, args.apps);
  • src/index.js:83-83 (registration)
    Tool name registration in the ListTools response.
    name: 'create_quad_layout',
Behavior2/5

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

With no annotations, the description carries the full burden but only states the basic action without disclosing behavioral traits like whether it overwrites existing layouts, requires specific permissions, or has side effects. It lacks details on error handling or what happens if apps are not open.

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 purpose without unnecessary words, making it easy to parse quickly.

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?

For a creation tool with no annotations and no output schema, the description is incomplete. It misses key context such as the expected behavior on success/failure, whether the layout becomes active immediately, or how it interacts with existing layouts, leaving gaps for an AI agent.

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 fully documents parameters. The description adds no additional meaning beyond implying the layout is 2x2, which is already clear from the tool name and schema. Baseline 3 is appropriate as the schema handles parameter documentation.

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

Purpose5/5

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

The description clearly states the action ('Create'), the resource ('quad (2x2) window layout'), and the target ('on a specific display'), distinguishing it from siblings like 'create_custom_grid_layout' by specifying the exact layout type (2x2 quad).

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?

No guidance is provided on when to use this tool versus alternatives like 'create_custom_grid_layout' or 'activate_layout', nor does it mention prerequisites such as needing the display to be available or apps to be installed.

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