Skip to main content
Glama
cablate

MCP Google Map Server

maps_elevation

Retrieve elevation data for specific geographic coordinates using Google Maps API integration on the MCP Google Map Server. Input latitude and longitude to access precise altitude information for multiple locations.

Instructions

獲取位置的海拔數據

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationsYes要獲取海拔數據的位置列表

Implementation Reference

  • The ACTION function that executes the maps_elevation tool: creates PlacesSearcher with API key, fetches elevation data for locations, handles errors, and returns formatted JSON response.
    async function ACTION(params: any): Promise<{ content: any[]; isError?: boolean }> {
      try {
        // Create a new PlacesSearcher instance with the current request's API key
        const apiKey = getCurrentApiKey();
        const placesSearcher = new PlacesSearcher(apiKey);
        const result = await placesSearcher.getElevation(params.locations);
    
        if (!result.success) {
          return {
            content: [{ type: "text", text: result.error || "Failed to get elevation data" }],
            isError: true,
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result.data, null, 2),
            },
          ],
          isError: false,
        };
      } catch (error: any) {
        const errorMessage = error instanceof Error ? error.message : JSON.stringify(error);
        return {
          isError: true,
          content: [{ type: "text", text: `Error getting elevation data: ${errorMessage}` }],
        };
      }
    }
  • Zod schema defining the input parameters: array of {latitude, longitude} objects for locations.
    const SCHEMA = {
      locations: z.array(z.object({
        latitude: z.number().describe("Latitude coordinate"),
        longitude: z.number().describe("Longitude coordinate"),
      })).describe("List of locations to get elevation data for"),
    };
  • src/config.ts:59-64 (registration)
    Registers the maps_elevation tool (imported as Elevation from ./tools/maps/elevation.js) in the server tools configuration passed to BaseMcpServer.
    {
      name: Elevation.NAME,
      description: Elevation.DESCRIPTION,
      schema: Elevation.SCHEMA,
      action: (params: ElevationParams) => Elevation.ACTION(params),
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While '獲取' (get/retrieve) implies a read operation, the description doesn't address important behavioral aspects like rate limits, authentication requirements, data freshness, accuracy, or what happens with invalid coordinates. For a tool with zero annotation coverage, this represents significant gaps in behavioral context.

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 extremely concise - a single phrase that directly states the tool's purpose without any unnecessary words. It's front-loaded with the essential information and contains zero wasted content. Every word earns its place in communicating the core functionality.

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 absence of annotations and output schema, the description is insufficiently complete. For a tool that presumably returns elevation data, the description doesn't indicate what format the elevation data comes in (meters/feet, precision), whether it returns single values or arrays, or what happens with multiple locations. The lack of behavioral context combined with no output information creates significant gaps for agent understanding.

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 schema description coverage is 100%, with the single parameter 'locations' well-documented in the schema as an array of latitude/longitude objects. The description mentions '位置' (locations) which aligns with the parameter name but adds no additional semantic context beyond what the schema already provides. This meets the baseline expectation when schema coverage is complete.

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: retrieving elevation data for locations. It uses a specific verb ('獲取' - get/retrieve) and identifies the resource ('海拔數據' - elevation data). However, it doesn't differentiate from sibling tools like 'maps_geocode' or 'maps_reverse_geocode' which handle different geographic data types.

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 are multiple sibling mapping tools (geocode, reverse geocode, directions, etc.), but the description doesn't indicate that this tool specifically handles elevation data rather than other geographic information. No explicit when/when-not instructions or alternative suggestions are provided.

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

Related 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/cablate/mcp-google-map'

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