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);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions the specific model ('Gemini 2.5 Pro Vision'), it doesn't describe what the analysis entails, what format the results take, whether there are rate limits, authentication requirements, or any constraints on image size/format. For an AI vision tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 with zero waste. It's appropriately sized for a tool with two parameters and clearly states the core functionality. Every word earns its place without redundancy or unnecessary elaboration.

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?

For an AI vision analysis tool with no annotations and no output schema, the description is insufficient. It doesn't explain what kind of analysis is performed, what the output looks like, or any limitations/constraints. The agent knows what the tool is called and what model it uses, but not what to expect from using it or what constitutes appropriate usage.

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 both parameters thoroughly. The description doesn't add any additional meaning about the parameters beyond what's in the schema. It doesn't explain what constitutes appropriate 'imageData' or provide guidance on crafting effective 'prompt' values. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('analyze') and resource ('an image'), and specifies the method ('using Gemini 2.5 Pro Vision'). It distinguishes from the sibling tool 'generate_text' by focusing on image analysis rather than text generation. However, it doesn't explicitly contrast with the sibling tool in the description text itself.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. There's no mention of when this tool is appropriate, what types of analysis it performs, or how it differs from the sibling 'generate_text' tool. The agent must infer usage from the tool name and description alone.

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

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