get_last_screenshot
Retrieve the most recent screenshot as base64 encoded PNG data.
Overview
The get_last_screenshot tool returns the most recently taken screenshot from the configured screenshot directory. This is useful for retrieving previously captured screenshots without taking a new one.
Purpose
- Review Recent Captures: Access the last screenshot taken
- Workflow Continuity: Continue working with a previous screenshot
- Error Recovery: Retrieve screenshot if previous operation failed
- Batch Processing: Process screenshots after capture
Input Schema
json
{
"type": "object",
"properties": {}
}No parameters required.
Output
Returns the most recent screenshot or a message if none found:
Success Response
json
{
"content": [
{
"type": "text",
"text": "Last screenshot: /path/to/screenshot.png"
},
{
"type": "image",
"data": "base64encodedpngdata...",
"mimeType": "image/png"
}
]
}No Screenshots Found
json
{
"content": [
{
"type": "text",
"text": "No screenshots found in the configured directory."
}
]
}Examples
Basic Usage
typescript
// Get the last screenshot
const result = await get_last_screenshot({});Workflow Example
typescript
// Take a screenshot
await take_screenshot({});
// Do some processing...
// Later, retrieve the screenshot
const lastScreenshot = await get_last_screenshot({});Configuration
Uses the same directory as take_screenshot:
bash
export ORCHESTRE_SCREENSHOT_PATH="/path/to/screenshots"Default: ~/Desktop/orchestre-screenshots
Use Cases
1. Documentation Workflow
typescript
// Capture multiple UI states
await take_screenshot({}); // State 1
// Make changes
await take_screenshot({}); // State 2
// Later, retrieve for documentation
const screenshot = await get_last_screenshot({});2. Error Analysis
typescript
// If an error occurred and screenshot was taken
try {
// Some operation
} catch (error) {
await take_screenshot({});
// Later in error report
const errorScreenshot = await get_last_screenshot({});
}3. Verification
typescript
// Verify screenshot was taken successfully
await take_screenshot({});
const verification = await get_last_screenshot({});
// Check if screenshot exists and is validFile Management
The tool finds the most recent PNG file by:
- Scanning the configured directory
- Filtering for
.pngfiles - Sorting by modification time
- Returning the newest file
Best Practices
- Check Directory: Ensure screenshot directory exists
- Handle No Screenshots: Always handle the case of no screenshots
- Clean Old Screenshots: Regularly clean up old screenshots
- Verify Timing: Most recent may not be the one you expect
Related Tools
take_screenshot- Take new screenshotslist_windows- List windows for targeted capture
Limitations
- Only returns PNG files
- Returns only the most recent screenshot
- No filtering by date range or other criteria
- Cannot retrieve specific screenshots by name
