Skip to main content
Glama

Windows Automation MCP Server

browser_screenshot

Capture webpage screenshots in Windows automation workflows. Save screenshots to specified paths and choose between visible area or full-page captures for documentation and testing purposes.

Instructions

截取网页截图

Input Schema

NameRequiredDescriptionDefault
pathNo保存路径(可选)
fullPageNo是否整页截图(可选)
sessionIdNo会话 ID(可选)

Input Schema (JSON Schema)

{ "properties": { "fullPage": { "description": "是否整页截图(可选)", "type": "boolean" }, "path": { "description": "保存路径(可选)", "type": "string" }, "sessionId": { "description": "会话 ID(可选)", "type": "string" } }, "type": "object" }

Implementation Reference

  • Core implementation of the browser_screenshot tool. Takes screenshot of the page associated with sessionId, saves to specified path or generates default timestamped path, supports fullPage option.
    async screenshot(savePath, fullPage = false, sessionId = 'default') { try { const page = this.pages.get(sessionId); if (!page) { return { success: false, error: '浏览器未启动' }; } const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); const defaultPath = `screenshot-browser-${timestamp}.png`; const path = savePath || defaultPath; await page.screenshot({ path, fullPage }); return { success: true, path, fullPage, message: '截图已保存' }; } catch (error) { return { success: false, error: error.message }; } }
  • Input schema defining optional parameters: path (save location), fullPage (boolean for full page screenshot), sessionId (browser session identifier).
    inputSchema: { type: 'object', properties: { path: { type: 'string', description: '保存路径(可选)' }, fullPage: { type: 'boolean', description: '是否整页截图(可选)' }, sessionId: { type: 'string', description: '会话 ID(可选)' }, }, },
  • Tool definition object in getToolDefinitions() method, registering the browser_screenshot tool with name, description, and schema.
    { name: 'browser_screenshot', description: '截取网页截图', inputSchema: { type: 'object', properties: { path: { type: 'string', description: '保存路径(可选)' }, fullPage: { type: 'boolean', description: '是否整页截图(可选)' }, sessionId: { type: 'string', description: '会话 ID(可选)' }, }, }, },
  • Dispatch logic in executeTool() switch statement, routing browser_screenshot calls to the screenshot handler.
    case 'browser_screenshot': return await this.screenshot(args.path, args.fullPage, args.sessionId);
  • Inclusion of 'browser_screenshot' in the canHandle() tool list for tool dispatching.
    const tools = ['browser_launch', 'browser_navigate', 'browser_click', 'browser_type', 'browser_screenshot', 'browser_get_text', 'browser_close']; return tools.includes(toolName);

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/eva-wanxin-git/windows-automation-mcp'

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