Skip to main content
Glama

pilot_annotated_screenshot

Take screenshots with visual annotations to identify and label elements for browser automation testing and debugging.

Instructions

Take a screenshot with red overlay boxes and ref labels at each @eN/@cN position. Requires a prior pilot_snapshot call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_pathNoOutput file path for the screenshot

Implementation Reference

  • Handler for the pilot_annotated_screenshot tool, which calls annotateScreenshot and returns the result as an image.
    server.tool(
      'pilot_annotated_screenshot',
      'Take a screenshot with red overlay boxes and ref labels at each @eN/@cN position. Requires a prior pilot_snapshot call.',
      {
        output_path: z.string().optional().describe('Output file path for the screenshot'),
      },
      async ({ output_path }) => {
        await bm.ensureBrowser();
        try {
          const screenshotPath = await annotateScreenshot(bm, output_path);
          bm.resetFailures();
    
          // Read the image and return as base64
          const imageData = fs.readFileSync(screenshotPath);
          const base64 = imageData.toString('base64');
    
          return {
            content: [
              { type: 'text' as const, text: `Annotated screenshot saved: ${screenshotPath}` },
              { type: 'image' as const, data: base64, mimeType: 'image/png' },
            ],
          };
        } catch (err) {
          bm.incrementFailures();
          return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
        }
      }
    );

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/TacosyHorchata/Pilot'

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