Skip to main content
Glama

gps-coordinates

Extract GPS coordinates (latitude and longitude) from image metadata to identify photo locations. Supports various image formats including paths, URLs, and encoded data.

Instructions

Extract GPS coordinates (latitude/longitude) from image metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYes

Implementation Reference

  • The handler function for the 'gps-coordinates' tool. It loads the image into a buffer using loadImage, extracts GPS data using exifr.gps(), and returns a standardized success response with the coordinates or null, or an error response.
    async (args, extra) => {
      try {
        const { image } = args;
        const buf = await loadImage(image);
        const gps = await exifr.gps(buf);
        
        return createSuccessResponse(gps || null);
      } catch (error) {
        return createErrorResponse(`Error reading GPS data: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Shared Zod schema defining the 'image' input parameter structure (ImageSourceType) used by the 'gps-coordinates' tool and others.
    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()
    });
  • Registration of the 'gps-coordinates' tool on the MCP server, including description, input schema reference, and handler function.
    // Tool 10: gps-coordinates - extracts GPS coordinates
    const gpsCoordinatesTool = server.tool('gps-coordinates',
      "Extract GPS coordinates (latitude/longitude) from image metadata",
      {
        image: ImageSourceSchema
      },
      async (args, extra) => {
        try {
          const { image } = args;
          const buf = await loadImage(image);
          const gps = await exifr.gps(buf);
          
          return createSuccessResponse(gps || null);
        } catch (error) {
          return createErrorResponse(`Error reading GPS data: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
    );
    tools['gps-coordinates'] = gpsCoordinatesTool;
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 the tool extracts GPS coordinates but doesn't mention potential issues like missing metadata, error handling, format of returned coordinates, or performance considerations. For a tool with no annotation coverage, this is a significant gap in describing how it behaves beyond the basic action.

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: 'Extract GPS coordinates (latitude/longitude) from image metadata.' It's front-loaded with the core purpose, uses no unnecessary words, and is appropriately sized for the tool's complexity. Every part of the sentence earns its place by specifying the action, target, and source.

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's complexity (1 parameter with nested objects, no output schema, no annotations), the description is incomplete. It doesn't address how coordinates are returned, what happens if no GPS data is present, or details about the 'image' parameter. For a tool that extracts data from images, more context is needed to guide effective use.

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 description adds no information about parameters beyond what the input schema provides. With 0% schema description coverage and 1 parameter (a nested object 'image'), the schema alone defines the structure (e.g., 'kind' with enum values). The description doesn't explain what 'image' represents or how to use the 'kind' options, so it doesn't compensate for the low coverage, resulting in a baseline score.

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's purpose: 'Extract GPS coordinates (latitude/longitude) from image metadata.' It specifies the verb ('extract'), resource ('GPS coordinates'), and source ('image metadata'), making it easy to understand what the tool does. However, it doesn't explicitly distinguish itself from sibling tools like 'read-exif' or 'read-metadata', which might also handle GPS data, so it misses full sibling differentiation.

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. With sibling tools like 'read-exif' and 'read-metadata' that might overlap in functionality, there's no indication of specific use cases, prerequisites, or exclusions. This leaves the agent without clear direction on tool selection in this context.

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