Skip to main content
Glama
Wladastic

AutoProbeMCP

by Wladastic

analyze_screenshot

Capture and analyze web page screenshots using AI to describe visible content, detect elements, and provide structural insights based on user-defined context.

Instructions

Take a screenshot and analyze it with AI (Gemma3) to describe what is visible on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailedNoProvide detailed structural analysis of the page
fullPageNoCapture full scrollable page
modelNoAI model to use for analysis (default: gemma3:4b)gemma3:4b
pathNoPath to save screenshot (optional)
pretextNoOptional context or specific instructions for what to look for in the analysis

Implementation Reference

  • Handler for the 'analyze_screenshot' tool. Takes a screenshot of the current page, encodes it as base64, analyzes it using Ollama (default gemma3:4b) with a customizable prompt, and returns the AI-generated description. Handles errors by providing fallback screenshot info.
              case 'analyze_screenshot': {
                if (!currentPage) {
                  throw new Error('No browser page available. Launch a browser first.');
                }
    
                const params = AnalyzeScreenshotSchema.parse(args);
                
                // Take screenshot
                const screenshotPath = params.path || `screenshot-${Date.now()}.png`;
                const screenshotBuffer = await currentPage.screenshot({ 
                  fullPage: params.fullPage,
                  path: screenshotPath
                });
    
                try {
                  // Initialize Ollama client
                  const ollama = new Ollama({ host: 'http://localhost:11434' });
    
                  // Convert screenshot to base64
                  const base64Image = screenshotBuffer.toString('base64');
    
                  // Prepare the prompt
                  let prompt = 'Analyze this website screenshot and describe exactly what you see. ';
                  
                  if (params.detailed) {
                    prompt += 'Provide a detailed structural analysis including layout, navigation elements, content sections, forms, buttons, and any interactive elements. ';
                  } else {
                    prompt += 'Focus on the main content and key elements visible on the page. ';
                  }
    
                  if (params.pretext) {
                    prompt += `Additional context/instructions: ${params.pretext}. `;
                  }
    
                  prompt += 'Be specific about colors, text content, images, and the overall design and functionality of the page.';
    
                  // Make AI request
                  const response = await ollama.generate({
                    model: params.model,
                    prompt: prompt,
                    images: [base64Image],
                    stream: false
                  });
    
                  return {
                    content: [
                      {
                        type: 'text',
                        text: `AI Analysis of Screenshot (${screenshotPath}):
    
    ${response.response}
    
    Screenshot saved to: ${screenshotPath}
    Model used: ${params.model}
    Analysis type: ${params.detailed ? 'Detailed structural analysis' : 'General description'}`
                      }
                    ]
                  };
    
                } catch (aiError) {
                  // If AI analysis fails, still return screenshot info
                  const fallbackMessage = aiError instanceof Error ? aiError.message : String(aiError);
                  
                  return {
                    content: [
                      {
                        type: 'text',
                        text: `Screenshot taken and saved to: ${screenshotPath}
    
    AI Analysis Error: ${fallbackMessage}
    
    Note: Make sure Ollama is running locally with the ${params.model} model installed.
    You can install it with: ollama pull ${params.model}
    And start Ollama with: ollama serve`
                      }
                    ]
                  };
                }
              }
  • Zod schema definition for validating inputs to the analyze_screenshot tool, including options for fullPage screenshot, save path, AI prompt pretext, model, and detailed analysis flag.
    const AnalyzeScreenshotSchema = z.object({
      fullPage: z.boolean().default(false),
      path: z.string().optional(),
      pretext: z.string().optional(),
      model: z.string().default('gemma3:4b'),
      detailed: z.boolean().default(false)
    });
  • src/index.ts:330-361 (registration)
    Tool registration in the ListTools response, defining the name, description, and JSON inputSchema for analyze_screenshot.
    {
      name: 'analyze_screenshot',
      description: 'Take a screenshot and analyze it with AI (Gemma3) to describe what is visible on the page',
      inputSchema: {
        type: 'object',
        properties: {
          fullPage: {
            type: 'boolean',
            default: false,
            description: 'Capture full scrollable page'
          },
          path: {
            type: 'string',
            description: 'Path to save screenshot (optional)'
          },
          pretext: {
            type: 'string',
            description: 'Optional context or specific instructions for what to look for in the analysis'
          },
          model: {
            type: 'string',
            default: 'gemma3:4b',
            description: 'AI model to use for analysis (default: gemma3:4b)'
          },
          detailed: {
            type: 'boolean',
            default: false,
            description: 'Provide detailed structural analysis of the page'
          }
        }
      }
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions taking a screenshot and analyzing with AI, but lacks details on permissions, rate limits, whether it modifies the page, or what the output format looks like. For a tool with no annotations and no output schema, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action and purpose without unnecessary details. Every word earns its place by specifying the tool's function, method (AI with Gemma3), and goal, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of an AI analysis tool with no annotations and no output schema, the description is incomplete. It does not explain behavioral aspects like what the analysis returns, error conditions, or dependencies, leaving significant gaps for an agent to understand how to use it effectively beyond the basic action.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what the schema provides, such as explaining interactions between parameters or use cases. With high schema coverage, the baseline score of 3 is appropriate, as the description does not compensate but also does not detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Take a screenshot and analyze it with AI') and the resource ('what is visible on the page'), distinguishing it from sibling tools like 'screenshot' (which only captures) and 'get_page_info' (which provides different information). It specifies the AI model (Gemma3) for analysis, making the purpose explicit and distinct.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for analyzing page content via AI after capturing a screenshot, providing clear context. However, it does not explicitly state when to use this tool versus alternatives like 'get_element_text' for text extraction or 'screenshot' for capture-only, nor does it mention exclusions or prerequisites, leaving some guidance gaps.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/Wladastic/AutoProbeMCP'

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