Skip to content

Add screenshot capture tools #5

@NakaokaRei

Description

@NakaokaRei

Description

Add tools for capturing screenshots of the entire screen or specific regions.

SwiftAutoGUI API Reference

  • screenshot() - Capture entire screen
  • screenshot(region: CGRect) - Capture specific screen region
  • screenshot(imageFilename: String) - Save screenshot to file

Proposed Implementation

Create screenshot-related tools:

screenshot

  • Input:
    • region (object, optional) - {x, y, width, height} for specific region
    • filename (string, optional) - Path to save the screenshot
  • Output: Base64 encoded image data or file path

Implementation Options

  1. Return base64 encoded image data for MCP transport
  2. Save to temporary file and return path
  3. Both options based on parameters

Use Cases

  • Visual verification in automation
  • Capturing application state
  • Debugging automation scripts
  • Creating visual logs

Technical Considerations

  • Image format (PNG, JPEG)
  • File permissions and paths
  • Memory usage for large screenshots
  • Base64 encoding for data transport

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions