Skip to main content
Glama

list_layouts

Retrieve all saved Moom window layouts on macOS through the Moom MCP Server. Ideal for managing and organizing window configurations programmatically.

Instructions

List all saved Moom layouts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'list_layouts' tool. It executes an AppleScript command to query Moom for its list of layouts, parses the comma-separated result into an array, and returns a formatted JSON response containing the layouts and count, or an error message if failed.
    async listLayouts() { const script = ` tell application "Moom" list of layouts end tell `; try { const result = await this.runAppleScript(script); const layouts = result.split(', ').map(name => name.trim()); return { content: [ { type: 'text', text: JSON.stringify({ layouts: layouts, count: layouts.length }, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error listing layouts: ${error.message}`, }, ], }; } }
  • src/index.js:128-135 (registration)
    Registration of the 'list_layouts' tool in the ListToolsRequestSchema handler response array. Defines the tool name, description, and input schema (empty object since no parameters required).
    { name: 'list_layouts', description: 'List all saved Moom layouts', inputSchema: { type: 'object', properties: {}, }, },
  • Input schema definition for the 'list_layouts' tool, specifying an empty object (no required parameters).
    inputSchema: { type: 'object', properties: {}, },
  • Helper utility function used by listLayouts() to execute AppleScript commands via osascript, capturing stdout and handling stderr/errors.
    async runAppleScript(script) { try { const { stdout, stderr } = await execAsync(`osascript -e '${script}'`); if (stderr) { throw new Error(stderr); } return stdout.trim(); } catch (error) { throw new Error(`AppleScript error: ${error.message}`); } }
  • src/index.js:217-218 (registration)
    Dispatch case in the CallToolRequestSchema handler switch statement that routes 'list_layouts' tool calls to the listLayouts() method. (Note: Duplicate case exists at lines 223-224.)
    case 'list_layouts': return await this.listLayouts();

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