import { createAutomationProvider } from '../providers/factory.js';
import { ScreenshotOptions } from '../types/common.js';
import { WindowsControlResponse } from '../types/responses.js';
/**
* Captures a screenshot with various options for optimization
*
* @param options Optional configuration for the screenshot
* @returns Promise resolving to a WindowsControlResponse with the screenshot data
*/
export async function getScreenshot(options?: ScreenshotOptions): Promise<WindowsControlResponse> {
try {
// Create a provider instance to handle the screenshot
const provider = createAutomationProvider();
// Delegate to the provider's screenshot implementation
const result = await provider.screen.getScreenshot(options);
// Return the result directly from the provider
return result;
} catch (error) {
return {
success: false,
message: `Failed to capture screenshot: ${error instanceof Error ? error.message : String(error)}`,
};
}
}
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/claude-did-this/MCPControl'
If you have feedback or need assistance with the MCP directory API, please join our Discord server