Skip to main content
Glama

altitude

Get elevation data for any geographic coordinate by providing latitude and longitude values. This tool queries France's Géoplateforme altimetry database to return precise altitude measurements.

Instructions

Renvoie l'altitude pour une position donnée par sa longitude et sa latitude (source : Géoplateforme (altimétrie)).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lonYesLa longitude du point
latYesLa latitude du point

Implementation Reference

  • The main handler function for the 'altitude' tool. It logs the input coordinates and delegates the altitude retrieval to the getAltitudeByLocation helper function.
    async execute(input: AltitudeInput) {
      logger.info(`altitude(${input.lon},${input.lat})...`);
      return getAltitudeByLocation(input.lon, input.lat);
    }
  • Zod-based input schema defining longitude (lon) and latitude (lat) as numbers with French descriptions.
    schema = {
      lon: {
        type: z.number(),
        description: "La longitude du point",
      },
      lat: {
        type: z.number(),
        description: "La latitude du point",
      },
    };
  • Tool class definition extending MCPTool, setting the name to 'altitude' and providing a description. This likely serves as the registration point within the MCP framework.
    class AltitudeTool extends MCPTool<AltitudeInput> {
      name = "altitude";
      description = `Renvoie l'altitude pour une position donnée par sa longitude et sa latitude (source : ${ALTITUDE_SOURCE}).`;
  • Core helper function that queries the Géoplateforme API to retrieve altitude data for given coordinates, handling errors by returning null altitude.
    export async function getAltitudeByLocation(lon, lat) {
        logger.info(`getAltitudeByLocation(${lon},${lat})...`);
        
        const url = `https://data.geopf.fr/altimetrie/1.0/calcul/alti/rest/elevation.json?lon=${lon}&lat=${lat}&resource=ign_rge_alti_wld`;
        try {
            const json = await fetchJSON(url);
            const elevation = json.elevations[0] ;
            return {
                lon: lon,
                lat: lat,
                altitude: elevation.z,
                accuracy: elevation.acc,
            };
        }catch(e){
            return {
                lon: lon,
                lat: lat,
                altitude: null,
                accuracy: 'No data',
            };
        }
    
    
    }
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 returns altitude data from a specific source, but doesn't mention error handling, rate limits, authentication needs, or what happens with invalid coordinates. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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 a single, efficient sentence that states the core functionality and data source. It's appropriately sized for a simple tool with two parameters, though it could be slightly more front-loaded by moving the source information to a secondary position.

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?

Given the tool's simplicity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It explains what the tool does but lacks details on output format, error conditions, and usage context relative to siblings. The absence of an output schema means the description should ideally hint at return values, which it doesn't.

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 clear documentation for both parameters (lon and lat). The description adds minimal value beyond the schema by mentioning that these parameters define a position, but doesn't provide additional context like coordinate systems, valid ranges, or units. This meets the baseline for high schema coverage.

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: 'Renvoie l'altitude pour une position donnée par sa longitude et sa latitude' (Returns altitude for a position given by its longitude and latitude). It specifies the verb ('renvoie'), resource ('altitude'), and input parameters. However, it doesn't explicitly distinguish this tool from its siblings (e.g., geocode, cadastre), which prevents a perfect score.

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 mentions the data source ('source : Géoplateforme (altimétrie)'), but doesn't explain when altitude data is needed compared to other geographic tools like geocode or cadastre. There are no explicit when/when-not instructions or named alternatives.

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/ignfab/geocontext'

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