get_screen_info
Retrieve display configuration details including screen count, resolutions, positions, and scaling factors for macOS desktop automation.
Instructions
Retrieve display configuration: number of displays, per-display resolution, origin, and scale factor.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/screen.ts:70-94 (handler)The handler function that executes the get_screen_info tool logic by invoking the Swift helper and formatting the output.
async function handleGetScreenInfo(): Promise<CallToolResult> { const response = await runInputHelper("display_info", {}); const { displays: rawDisplays } = DisplayInfoResponseSchema.parse(response); const displays: DisplayInfo[] = rawDisplays.map((d) => ({ name: d.name, resolution: { width: d.width, height: d.height }, origin: { x: d.x, y: d.y }, scaleFactor: d.scaleFactor, })); const result = { displayCount: displays.length, displays, }; return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2), }, ], }; } - src/tools/screen.ts:19-19 (schema)Input validation schema for get_screen_info tool.
const GetScreenInfoInputSchema = z.object({}); - src/tools/screen.ts:46-55 (registration)Registration definition for the get_screen_info tool.
{ name: "get_screen_info", description: "Retrieve display configuration: number of displays, per-display resolution, origin, and scale factor.", inputSchema: zodToToolInputSchema(GetScreenInfoInputSchema), annotations: { readOnlyHint: true, destructiveHint: false, }, },