Skip to main content
Glama
eva-wanxin-git

Windows Automation MCP Server

browser_screenshot

Capture webpage screenshots through browser automation. Save full-page or partial screenshots to specified paths for documentation or testing purposes.

Instructions

截取网页截图

Input Schema

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

Implementation Reference

  • The `screenshot` method that executes the `browser_screenshot` tool logic using Puppeteer's `page.screenshot()` to capture the page screenshot and save it to a file.
    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 };
      }
  • The tool definition including the input schema for `browser_screenshot` in `getToolDefinitions()`.
    {
      name: 'browser_screenshot',
      description: '截取网页截图',
      inputSchema: {
        type: 'object',
        properties: {
          path: { type: 'string', description: '保存路径(可选)' },
          fullPage: { type: 'boolean', description: '是否整页截图(可选)' },
          sessionId: { type: 'string', description: '会话 ID(可选)' },
        },
      },
    },
  • The switch case in `executeTool` method that registers and dispatches the `browser_screenshot` tool call to its handler.
    case 'browser_screenshot':
      return await this.screenshot(args.path, args.fullPage, args.sessionId);

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