Skip to main content
Glama

Apply a window layout preset

hs_window_layout

Snap a window to a named position like left-half or quarter-top-left without pixel math. Positions respect the menu bar and Dock; defaults to the focused window.

Instructions

Snap a window to a named position such as left-half or quarter-top-left, computed from the screen size so no pixel arithmetic is needed. Defaults to the focused window. Positions respect the menu bar and Dock.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
presetYesNamed layout to apply.
windowIdNoWindow id from hs_list_windows. Defaults to the focused window.
screenIndexNoZero-based screen index from hs_screens. Defaults to the screen the window is already on. Use this to move a window to another display and position it in one call.
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses meaningful behavioral traits: the tool defaults to the focused window and respects the menu bar and Dock insets. It does not cover error handling, permissions, or reversibility, but for a simple window-snapping action these are less critical. The disclosed behaviors add value beyond the schema.

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?

Two concise sentences that are front-loaded with the primary action. Every word serves a purpose: examples clarify presets, the screen-size note explains the benefit, and the default/inset behaviors are essential context. No redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple action tool without an output schema, the description provides sufficient context: what it does, how positions are computed, default target, and screen boundary handling. It could mention edge cases (e.g., invalid window ID), but these are not essential for a basic layout preset operation. The tool feels adequately specified.

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 coverage is 100% with descriptive parameter text, especially for windowId and screenIndex. The description reiterates the windowId default (focused window) but does not add new parameter-level detail beyond what the schema already states. Since the schema fully documents all parameters, a baseline score of 3 is appropriate.

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?

Clearly states it snaps a window to a named position, provides specific preset examples (left-half, quarter-top-left), and distinguishes itself from coordinate-based tools by emphasizing that it computes positions from screen size, eliminating the need for pixel arithmetic. This makes the tool's purpose unambiguous and differentiates it from siblings like hs_move_window.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description conveys the intended use case (preset layout snapshots) and notes that it defaults to the focused window, which is helpful. It stops short of explicitly stating when to use this tool versus hs_move_window or other alternatives, but the 'no pixel arithmetic needed' phrasing implies a simpler, preset-driven approach. This is clear context without explicit exclusions.

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/vukvukovich/hammerspoon-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server