Skip to main content
Glama

analyze_image

Analyze images with AI to extract descriptions, identify objects, and answer questions about visual content using Google's Gemini Pro Vision technology.

Instructions

Analyze an image using Gemini 2.5 Pro Vision

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageDataYesBase64 encoded image data
promptNoText prompt to describe what to analyze in the imageDescribe this image

Implementation Reference

  • The main handler function that executes the analyze_image tool. It processes base64-encoded image data and an optional prompt, uses the Gemini model for vision analysis, and returns the generated text description.
    private async handleImageAnalysis(args: any) { const { imageData, prompt = "Describe this image" } = args; // Convert base64 to proper format for Gemini const imagePart = { inlineData: { data: imageData, mimeType: "image/jpeg", // Adjust based on your needs }, }; const result = await this.model.generateContent({ contents: [ { role: "user", parts: [{ text: prompt }, imagePart], }, ], }); const response = result.response; const text = response.text(); return { content: [ { type: "text", text: text, }, ], };
  • src/index.ts:73-91 (registration)
    Registration of the analyze_image tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    { name: "analyze_image", description: "Analyze an image using Gemini 2.5 Pro Vision", inputSchema: { type: "object", properties: { imageData: { type: "string", description: "Base64 encoded image data", }, prompt: { type: "string", description: "Text prompt to describe what to analyze in the image", default: "Describe this image", }, }, required: ["imageData"], }, },
  • Input schema definition for the analyze_image tool, specifying base64 imageData as required and optional prompt.
    inputSchema: { type: "object", properties: { imageData: { type: "string", description: "Base64 encoded image data", }, prompt: { type: "string", description: "Text prompt to describe what to analyze in the image", default: "Describe this image", }, }, required: ["imageData"], },
  • src/index.ts:104-105 (registration)
    Dispatch/registration of the analyze_image handler in the CallToolRequestSchema switch statement.
    case "analyze_image": return await this.handleImageAnalysis(args);
Install Server

Other 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/lutic1/Google-MCP-Server-'

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