Skip to main content
Glama
jicoing

MCP Image Metadata Server

by jicoing

extract_batch_metadata

Extract EXIF, GPS, IPTC, and XMP metadata from up to 50 images in a single batch operation, with optional color data extraction.

Instructions

Extract metadata from multiple images (max 50). Price: $0.001-0.005 USDC via x402

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageUrlsYes
optionsNo
paymentHeaderNox402 payment header (if paying for access)
payerNoCaller wallet address (for freemium tracking)

Implementation Reference

  • The main handler function 'handleBatch' that executes the extract_batch_metadata tool logic. It validates payment, then extracts metadata from all image URLs in parallel via Promise.all.
    export async function handleBatch(
      input: BatchInput,
      paymentHeader?: string,
      payer?: string
    ): Promise<{
      success: boolean;
      data?: ImageMetadata[];
      price?: number;
      paymentStatus?: string;
      freemiumRemaining?: number;
      error?: string;
    }> {
      try {
        const { imageUrls, options } = input;
        const tier = getTierFromOptions(options || {});
        const price = calculatePrice(tier, imageUrls.length);
    
        if (paymentHeader || !checkFreemium(payer).allowed) {
          const payment = await verifyPayment(paymentHeader, tier, payer);
          if (!payment.valid) {
            return {
              success: false,
              price,
              paymentStatus: 'failed',
              freemiumRemaining: 0,
              error: payment.error || 'Payment verification failed',
            };
          }
        }
    
        const freemium = checkFreemium(payer);
        const results = await Promise.all(
          imageUrls.map(url => extractMetadata(url, options))
        );
    
        return {
          success: true,
          data: results,
          price,
          paymentStatus: freemium.allowed ? 'free' : 'paid',
          freemiumRemaining: freemium.allowed ? freemium.remaining : 0,
        };
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error',
        };
      }
    }
  • Schema definition BatchInputSchema for the batch tool's input validation (array of imageUrls with max 50 items, optional options).
    export const BatchInputSchema = z.object({
      imageUrls: z.array(z.string()).max(50),
      options: ExtractOptionsSchema.optional(),
    });
    
    export type BatchInput = z.infer<typeof BatchInputSchema>;
  • src/index.ts:66-95 (registration)
    Tool registration in the MCP server (stdio mode) - defines name, description, and inputSchema for extract_batch_metadata.
    {
      name: 'extract_batch_metadata',
      description: `Extract metadata from multiple images (max 50). Price: $${PRICING.basic.price}-${PRICING.premium.price} USDC via x402`,
      inputSchema: {
        type: 'object',
        properties: {
          imageUrls: {
            type: 'array',
            items: { type: 'string' },
            maxItems: 50,
          },
          options: {
            type: 'object',
            properties: {
              includeGps: { type: 'boolean' },
              includeColor: { type: 'boolean' },
            },
          },
          paymentHeader: {
            type: 'string',
            description: 'x402 payment header (if paying for access)',
          },
          payer: {
            type: 'string',
            description: 'Caller wallet address (for freemium tracking)',
          },
        },
        required: ['imageUrls'],
      },
    },
  • Tool registration in the HTTP server mode - defines name, description, and inputSchema for extract_batch_metadata.
    {
      name: 'extract_batch_metadata',
      description: `Extract metadata from multiple images (max 50). Price: $${PRICING.basic.price}-${PRICING.premium.price} USDC via x402`,
      inputSchema: {
        type: 'object',
        properties: {
          imageUrls: { type: 'array', items: { type: 'string' }, maxItems: 50 },
          options: { type: 'object' },
          paymentHeader: { type: 'string' },
          payer: { type: 'string' },
        },
        required: ['imageUrls'],
      },
    },
  • src/index.ts:146-151 (registration)
    Handler dispatch for extract_batch_metadata in stdio MCP server - calls handleBatch with parsed input.
    case 'extract_batch_metadata': {
      const { paymentHeader: _, payer: __, ...rest } = args as Record<string, unknown>;
      const input = BatchInputSchema.parse(rest);
      const result = await handleBatch(input, paymentHeader, payer);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
Behavior2/5

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

No annotations are provided, so the description bears the full burden. It mentions a price range and 'via x402' but does not explain the payment mechanism, what happens without payment, or any side effects. The max 50 limit is noted, but other behavioral traits (e.g., idempotency, error handling) are missing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and front-loads the core purpose. It is efficient with one sentence plus pricing. However, it could be slightly more structured to include behavior or parameter hints, but overall it is concise and not verbose.

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 tool has 4 parameters, nested objects, no output schema, and no annotations, the description is incomplete. It omits details about return values, error handling, authentication (beyond payment hint), and concurrency for batch processing. Significant gaps remain.

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 coverage is 50% (only paymentHeader and payer have descriptions). The description does not add any parameter-level detail beyond what is in the schema. For example, options is not explained, and imageUrls' limit is already in schema. No additional semantics are provided.

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 tool extracts metadata from multiple images with a max of 50, which is a specific verb+resource+limit. The name and sibling tools (extract_image_metadata) imply differentiation between batch and single, but the description does not explicitly distinguish, though it is still clear.

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 on when to use this tool versus alternatives like extract_image_metadata or detect_image_manipulation. The pricing mention hints at a payment requirement but does not explain prerequisites or when to choose batch over single image extraction.

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/jicoing/mcp-image-metadata'

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