Skip to main content
Glama

get_image_info

Extract metadata and technical details from image files to analyze dimensions, format, and properties for editing or processing workflows.

Instructions

Get metadata and information about an image

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputPathYesPath to image file

Implementation Reference

  • Handler implementation for the 'get_image_info' tool. Extracts image metadata using Sharp and file system stats, returns formatted JSON with image properties.
    case 'get_image_info': {
      const { inputPath } = args;
      
      const metadata = await sharp(inputPath).metadata();
      const stats = await fs.stat(inputPath);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              format: metadata.format,
              width: metadata.width,
              height: metadata.height,
              channels: metadata.channels,
              bitDepth: metadata.depth,
              colorSpace: metadata.space,
              density: metadata.density,
              hasAlpha: metadata.hasAlpha,
              fileSize: stats.size,
              lastModified: stats.mtime
            }, null, 2)
          }
        ]
      };
    }
  • Input schema definition for the 'get_image_info' tool, specifying the required inputPath parameter.
    inputSchema: {
      type: 'object',
      properties: {
        inputPath: { type: 'string', description: 'Path to image file' }
      },
      required: ['inputPath']
    }
  • src/index.ts:155-165 (registration)
    Registration of the 'get_image_info' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'get_image_info',
      description: 'Get metadata and information about an image',
      inputSchema: {
        type: 'object',
        properties: {
          inputPath: { type: 'string', description: 'Path to image file' }
        },
        required: ['inputPath']
      }
    },
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 states this is a 'Get' operation, implying it's likely read-only and non-destructive, but it doesn't explicitly confirm this or describe any side effects, error conditions, or output format. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 directly states the tool's purpose without any unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence earns its place by conveying essential information.

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

Completeness3/5

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

For a simple read operation with one parameter and no output schema, the description is minimally adequate but lacks depth. It doesn't explain what metadata is returned (e.g., dimensions, format, size) or any constraints, which would be helpful given the absence of annotations and output schema. The context signals indicate low complexity, so the description meets basic needs but could be more informative.

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?

The input schema has 100% description coverage, with the single parameter 'inputPath' clearly documented as 'Path to image file'. The description adds no additional meaning beyond this, such as acceptable file formats or path syntax. Given the high schema coverage, the baseline score of 3 is appropriate as the schema handles the parameter documentation adequately.

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 ('Get') and resource ('metadata and information about an image'), making the purpose immediately understandable. However, it doesn't differentiate this read operation from its siblings like 'batch_resize' or 'crop_image', which are image manipulation tools, so it doesn't fully distinguish itself in context.

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. It doesn't mention that this is for metadata retrieval rather than image processing like the sibling tools, nor does it specify prerequisites such as needing an existing image file. Without such context, the agent must infer usage from the tool name 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/flowy11/imagician'

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