Skip to main content
Glama
stadiamaps

Stadia Maps Location API MCP Server

isochrone

Calculate travel-time or distance-based reachable areas from a location using specified transportation modes, returning GeoJSON polygons for visualization and analysis.

Instructions

Generate isochrone contours showing areas reachable within specified time or distance constraints from a single location. Returns GeoJSON polygons representing the reachable areas.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationYesA geographic coordinate pair.
costingYesThe method of travel to use for isochrone calculation (auto = automobile).
contoursYesArray of 1-4 contours. All contours must be of the same type (all time or all distance).

Implementation Reference

  • Main handler function that constructs an IsochroneRequest, calls the Stadia Maps API, processes the response using a helper, or handles errors.
    export async function isochrone({
      location,
      costing,
      contours,
    }: IsochroneParams): Promise<CallToolResult> {
      return handleToolError(
        async () => {
          const request: IsochroneRequest = {
            locations: [location],
            costing,
            contours,
          };
    
          const response = await routeApi.isochrone({ isochroneRequest: request });
    
          if (instanceOfIsochroneResponse(response)) {
            return isochroneToolResult(response);
          } else {
            return {
              content: [
                {
                  type: "text",
                  text: "Unexpected response format from isochrone API.",
                },
              ],
            };
          }
        },
        {
          contextMessage: "Isochrone calculation failed",
          enableLogging: true,
        },
      );
    }
  • src/index.ts:91-100 (registration)
    Registers the 'isochrone' MCP tool with name, description, input schema (using imported zod schemas), and the handler function.
    server.tool(
      "isochrone",
      "Generate isochrone contours showing areas reachable within specified time or distance constraints from a single location. Returns GeoJSON polygons representing the reachable areas.",
      {
        location: coordinatesSchema,
        costing: isochroneCostingSchema,
        contours: contoursSchema,
      },
      isochrone,
    );
  • Zod schema for the costing model parameter used in the isochrone tool.
    export const isochroneCostingSchema = z
      .nativeEnum(IsochroneCostingModel)
      .describe(
        "The method of travel to use for isochrone calculation (auto = automobile).",
      );
  • Zod schema for the contours array parameter, including validation for consistency in time/distance types.
    export const contoursSchema = z
      .array(contourSchema)
      .min(1)
      .max(4)
      .describe(
        "Array of 1-4 contours. All contours must be of the same type (all time or all distance).",
      )
      .refine(
        (contours) => {
          const hasTime = contours.some((c) => c.time !== undefined);
          const hasDistance = contours.some((c) => c.distance !== undefined);
          return !(hasTime && hasDistance);
        },
        {
          message:
            "All contours must be of the same type (either all time-based or all distance-based).",
        },
      );
  • Helper function to format the IsochroneResponse into a CallToolResult text summary, extracting contour info and GeoJSON geometries.
    function isochroneToolResult(response: IsochroneResponse): CallToolResult {
      if (!response.features || !response.features.length) {
        return {
          content: [
            {
              type: "text",
              text: "No isochrone results found.",
            },
          ],
        };
      }
    
      const results = response.features
        .map((feature, index) => {
          const properties = feature.properties;
          if (!properties) return `Invalid result (no properties): ${index}`;
    
          const contourInfo = `Contour ${properties.contour}`;
    
          let metricInfo = "";
          if (properties?.metric === "time") {
            metricInfo = `Time: ${properties.contour} minutes`;
          } else if (properties?.metric === "distance") {
            metricInfo = `Distance: ${properties.contour} km`;
          }
    
          return [
            `${contourInfo}`,
            metricInfo ? `${metricInfo}` : "",
            `GeoJSON Geometry: ${JSON.stringify(feature.geometry)}`,
          ]
            .filter(Boolean)
            .join("\n");
        })
        .join("\n---\n");
    
      return {
        content: [
          {
            type: "text",
            text: `Isochrone Results:\n---\n${results}`,
          },
        ],
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'Returns GeoJSON polygons representing the reachable areas,' which covers the output format. However, it lacks critical behavioral details: whether this is a read-only operation, computational cost, rate limits, authentication requirements, or what happens with invalid inputs. For a geospatial computation tool with no annotation coverage, this is a significant gap.

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 perfectly concise with two sentences that each earn their place: the first defines the tool's purpose and scope, the second specifies the return format. It's front-loaded with the core functionality and contains zero redundant information.

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 moderate complexity (geospatial computation with multiple parameters and nested objects) and 100% schema coverage but no annotations or output schema, the description is minimally adequate. It covers the basic purpose and output format but lacks behavioral context that would be crucial for an AI agent to use this tool effectively in production scenarios. The absence of output schema means the description should ideally explain return values more thoroughly.

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?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'time or distance constraints' and 'single location,' which are already clear from parameter names and descriptions. The baseline score of 3 is appropriate when the schema does the heavy lifting, though the description doesn't provide additional context like parameter interactions or constraints beyond what's in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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 with specific verbs ('Generate isochrone contours') and resources ('areas reachable within specified time or distance constraints from a single location'). It distinguishes itself from siblings like geocode, route-overview, and static-map by focusing on reachability analysis rather than address lookup, routing, or map generation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through 'areas reachable within specified time or distance constraints,' suggesting it's for accessibility analysis. However, it provides no explicit guidance on when to use this tool versus alternatives like route-overview (which might provide point-to-point routing) or when not to use it. No prerequisites or sibling tool comparisons are mentioned.

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/stadiamaps/stadiamaps-mcp-server-ts'

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