Skip to main content
Glama
itrimble

Moom MCP Server

by itrimble

trigger_moom_action

Control window layouts on macOS by triggering Moom actions like resize, move, or center windows using keyboard shortcuts.

Instructions

Trigger common Moom actions via keyboard shortcuts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesMoom action to trigger

Implementation Reference

  • Executes the tool by mapping the action parameter to specific Moom keyboard shortcuts and running the corresponding AppleScript via System Events.
    async triggerMoomAction(action) {
      // Map actions to Moom keyboard shortcuts
      const shortcuts = {
        'grow': { key: '=', modifiers: 'control down, option down' },
        'shrink': { key: '-', modifiers: 'control down, option down' },
        'move-left': { key: '123', modifiers: 'control down, option down' }, // left arrow
        'move-right': { key: '124', modifiers: 'control down, option down' }, // right arrow
        'move-up': { key: '126', modifiers: 'control down, option down' }, // up arrow
        'move-down': { key: '125', modifiers: 'control down, option down' }, // down arrow
        'center': { key: 'c', modifiers: 'control down, option down' },
        'fill-screen': { key: 'return', modifiers: 'control down, option down' },
      };
    
      const shortcut = shortcuts[action];
      if (!shortcut) {
        return {
          content: [
            {
              type: 'text',
              text: `Unknown action: ${action}`,
            },
          ],
        };
      }
    
      const script = `
        tell application "System Events"
          ${shortcut.key.length > 1 
            ? `key code ${shortcut.key} using {${shortcut.modifiers}}`
            : `keystroke "${shortcut.key}" using {${shortcut.modifiers}}`}
        end tell
      `;
    
      try {
        await this.runAppleScript(script);
        return {
          content: [
            {
              type: 'text',
              text: `Successfully triggered Moom action: ${action}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${error.message}`,          },
          ],
        };
      }
    }
  • Defines the input schema for the trigger_moom_action tool, specifying the 'action' parameter as a string enum.
    inputSchema: {
      type: 'object',
      properties: {
        action: {
          type: 'string',
          enum: ['grow', 'shrink', 'move-left', 'move-right', 'move-up', 'move-down', 'center', 'fill-screen'],
          description: 'Moom action to trigger',
        },
      },
      required: ['action'],
    },
  • src/index.js:60-73 (registration)
    Registers the trigger_moom_action tool in the ListTools response, including name, description, and input schema.
      name: 'trigger_moom_action',
      description: 'Trigger common Moom actions via keyboard shortcuts',
      inputSchema: {
        type: 'object',
        properties: {
          action: {
            type: 'string',
            enum: ['grow', 'shrink', 'move-left', 'move-right', 'move-up', 'move-down', 'center', 'fill-screen'],
            description: 'Moom action to trigger',
          },
        },
        required: ['action'],
      },
    },
  • src/index.js:213-214 (registration)
    Dispatches calls to the trigger_moom_action tool by invoking the handler method in the main CallToolRequest handler.
    case 'trigger_moom_action':
      return await this.triggerMoomAction(args.action);
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 mentions 'via keyboard shortcuts', implying an interactive or system-level effect, but doesn't specify if this requires user permissions, has side effects like window resizing, or what happens on failure (e.g., if Moom isn't active). More details on behavior would improve transparency.

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 directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it easy for an agent 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?

Given no annotations and no output schema, the description is incomplete for a tool that triggers actions. It doesn't explain return values (e.g., success/failure status), error conditions, or dependencies like Moom being installed. For a tool with potential system interactions, more context is needed to guide effective use.

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?

The input schema has 100% description coverage, with the 'action' parameter fully documented via enum values. The description adds no additional parameter semantics beyond what the schema provides, such as explaining what each action does (e.g., 'grow' expands a window). Baseline score of 3 is appropriate as the schema handles the heavy lifting.

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 verb ('trigger') and resource ('common Moom actions'), specifying they are executed 'via keyboard shortcuts'. However, it doesn't explicitly differentiate this tool from sibling tools like 'activate_layout' or 'set_window_position', which might also involve Moom actions but with different mechanisms or purposes.

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, such as needing Moom running, or compare it to siblings like 'show_moom_menu' for accessing actions differently. This leaves the agent without context for tool selection.

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