Skip to main content
Glama

read-exif

Extract EXIF metadata from images to access camera settings, location data, and timestamps for analysis or verification purposes.

Instructions

Read EXIF data from an image with optional tag filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYes
pickNo

Implementation Reference

  • The handler function that loads the image buffer using loadImage, builds EXIF-specific parsing options with buildExifOptions, extracts metadata using exifr.parse, and returns a standardized success response with the EXIF data or an error response.
    async (args, extra) => {
      try {
        const { image, pick } = args;
        const buf = await loadImage(image);
        const opts = buildExifOptions(pick);
        const meta = await exifr.parse(buf, opts);
        
        if (!meta || Object.keys(meta).length === 0) {
          return createErrorResponse('No EXIF metadata found in image');
        }
        
        return createSuccessResponse(meta);
      } catch (error) {
        return createErrorResponse(`Error reading EXIF data: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Shared Zod schema defining the input 'image' parameter structure, supporting different image source kinds: path, url, base64 data, or buffer.
    const ImageSourceSchema = z.object({
      kind: z.enum(['path', 'url', 'base64', 'buffer']),
      path: z.string().optional(),
      url: z.string().optional(),
      data: z.string().optional(),
      buffer: z.string().optional()
    });
  • Registers the read-exif tool on the MCP server instance using server.tool(), providing name, description, input schema (image and optional pick), and the handler function; stores the tool reference in the tools object.
    // Tool 2: read-exif - reads EXIF data specifically
    const readExifTool = server.tool('read-exif',
      "Read EXIF data from an image with optional tag filtering",
      {
        image: ImageSourceSchema,
        pick: z.array(z.string()).optional()
      },
      async (args, extra) => {
        try {
          const { image, pick } = args;
          const buf = await loadImage(image);
          const opts = buildExifOptions(pick);
          const meta = await exifr.parse(buf, opts);
          
          if (!meta || Object.keys(meta).length === 0) {
            return createErrorResponse('No EXIF metadata found in image');
          }
          
          return createSuccessResponse(meta);
        } catch (error) {
          return createErrorResponse(`Error reading EXIF data: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
    );
    tools['read-exif'] = readExifTool;
  • Helper utility that constructs exifr parsing options specifically for the read-exif tool: enables TIFF (for EXIF), disables other segments, and includes optional specific tag picking.
    /**
     * Creates options object for the read-exif tool
     * @param pick Optional array of specific EXIF tags to pick
     * @returns Options object configured for EXIF reading
     */
    export function buildExifOptions(pick?: string[]): ExifrOptions {
      return {
        tiff: true,
        xmp: false,
        icc: false,
        iptc: false,
        jfif: false,
        ihdr: false,
        ...(pick ? { pick } : {})
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the tool reads EXIF data but doesn't disclose error handling (e.g., for invalid images), performance characteristics, or output format. The mention of 'optional tag filtering' hints at behavior but lacks specifics on how filtering works or what happens if no tags match.

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 purpose ('Read EXIF data from an image') and adds a useful qualifier ('with optional tag filtering'). There is no wasted verbiage or redundancy.

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 (2 parameters with a nested object, 0% schema coverage, no output schema, and no annotations), the description is inadequate. It doesn't explain the image input options (path, url, etc.), the tag filtering mechanism, or what the tool returns. For a tool with such rich input possibilities and no structured documentation elsewhere, more context is needed.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds little. It mentions 'optional tag filtering' which loosely relates to the 'pick' parameter, but doesn't explain what tags are available or how filtering is applied. The 'image' parameter is not addressed at all, leaving its complex nested structure (with 'kind', 'path', 'url', etc.) undocumented.

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 ('Read EXIF data') and resource ('from an image'), with additional scope ('with optional tag filtering'). It distinguishes from siblings like 'read-icc' or 'read-xmp' by specifying EXIF data specifically, though it doesn't explicitly contrast with 'read-metadata' which might be broader.

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?

No guidance is provided on when to use this tool versus alternatives like 'read-metadata' (which might read all metadata types) or 'gps-coordinates' (which might extract just GPS data). The description mentions optional tag filtering but doesn't explain when filtering is appropriate or what tags are available.

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/stass/exif-mcp'

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