Skip to main content
Glama

get_traffic_nearby

Find nearby traffic counting stations in Switzerland with current volume data. Input coordinates to get traffic monitoring points within a specified radius.

Instructions

Find ASTRA traffic counting stations near a geographic coordinate in Switzerland. Returns nearby stations with traffic volume data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latYesLatitude in WGS84 (e.g. 47.3769 for Zürich)
lonYesLongitude in WGS84 (e.g. 8.5417 for Zürich)
radiusNoSearch radius in meters (default: 5000)

Implementation Reference

  • The handler logic for 'get_traffic_nearby' which converts coordinates to LV95 and queries the ASTRA API.
    case "get_traffic_nearby": {
      const lat = args.lat as number;
      const lon = args.lon as number;
      const radius = (args.radius as number | undefined) ?? 5000;
    
      const [e, n] = wgs84ToLv95(lat, lon);
    
      // Build a map extent around the point using the radius
      const extentPadding = radius * 3;
      const mapExtent = `${e - extentPadding},${n - extentPadding},${e + extentPadding},${n + extentPadding}`;
    
      const url = buildUrl(`${GEO_ADMIN}/identify`, {
        geometry: `${e},${n}`,
        geometryType: "esriGeometryPoint",
        tolerance: radius,
        mapExtent,
        imageDisplay: "1,1,96",
        layers: `all:${TRAFFIC_LAYER}`,
        returnGeometry: false,
      });
      const data = await fetchJSON<IdentifyResponse>(url);
      const stations = data.results.map(slimTrafficStation);
      return JSON.stringify({
        count: stations.length,
        lat,
        lon,
        radius_m: radius,
        stations,
        source: "ASTRA — Federal Roads Office (Bundesamt für Strassen)",
      });
    }
  • The MCP tool definition and input schema for 'get_traffic_nearby'.
      name: "get_traffic_nearby",
      description:
        "Find ASTRA traffic counting stations near a geographic coordinate in Switzerland. Returns nearby stations with traffic volume data.",
      inputSchema: {
        type: "object",
        required: ["lat", "lon"],
        properties: {
          lat: {
            type: "number",
            description: "Latitude in WGS84 (e.g. 47.3769 for Zürich)",
          },
          lon: {
            type: "number",
            description: "Longitude in WGS84 (e.g. 8.5417 for Zürich)",
          },
          radius: {
            type: "number",
            description: "Search radius in meters (default: 5000)",
          },
        },
      },
    },
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. While it mentions what the tool returns ('nearby stations with traffic volume data'), it lacks critical behavioral details: whether this is a read-only operation, what format the data comes in, if there are rate limits, authentication requirements, or how 'nearby' is calculated beyond the radius parameter. For a tool with no annotation coverage, this is insufficient.

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 appropriately concise with two clear sentences that efficiently convey the core functionality. The first sentence explains what the tool does, and the second describes what it returns. There's no wasted language or redundancy. However, it could be slightly more structured by explicitly separating functionality from output description.

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 (geographic search with traffic data), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose and return type but lacks important contextual information: data format, pagination, error conditions, or how 'traffic volume data' is structured. The absence of output schema means the description should ideally provide more detail about return values.

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 (lat, lon, radius) with clear descriptions and examples. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain coordinate systems, valid ranges, or how radius interacts with results. Baseline 3 is appropriate when the schema does the heavy lifting.

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: 'Find ASTRA traffic counting stations near a geographic coordinate in Switzerland. Returns nearby stations with traffic volume data.' It specifies the verb ('Find'), resource ('ASTRA traffic counting stations'), and scope ('near a geographic coordinate in Switzerland'). However, it doesn't explicitly differentiate from sibling tools like 'get_traffic_by_canton' or 'get_traffic_count', 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 doesn't mention sibling tools like 'get_nearby_stations' (which might return different station types) or 'get_traffic_count' (which might provide traffic data without geographic filtering). There's also no information about prerequisites, constraints, or typical use cases beyond the basic functionality.

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/vikramgorla/mcp-swiss'

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