Skip to main content
Glama

analyze_image

Analyze image content using Google's Gemini Pro Vision AI to extract descriptions, identify objects, or answer questions about visual data.

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 handler function that executes the analyze_image tool. It processes base64 encoded image data and an optional prompt, constructs the content for Gemini's generateContent method using inlineData, generates the analysis, and returns the text response.
    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 ListTools response, including name, description, and input schema definition.
    { 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"], }, },
  • src/index.ts:104-105 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes analyze_image calls to the handleImageAnalysis method.
    case "analyze_image": return await this.handleImageAnalysis(args);
  • Input schema for the analyze_image tool defining parameters imageData (base64 string, 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"], },

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