Skip to main content
Glama

get_traffic_by_canton

Retrieve traffic counting station data for Swiss cantons. Access up to 20 stations with traffic measurements using 2-letter canton codes.

Instructions

List ASTRA traffic counting stations in a Swiss canton. Returns up to 20 stations with traffic data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cantonYes2-letter canton code (e.g. 'ZH', 'BE', 'GE', 'VS')

Implementation Reference

  • The handler implementation for the 'get_traffic_by_canton' tool, which processes the request, calls the ASTRA API, and formats the output.
    case "get_traffic_by_canton": {
      const canton = (args.canton as string).toUpperCase();
      const url = buildUrl(`${GEO_ADMIN}/find`, {
        layer: TRAFFIC_LAYER,
        searchText: canton,
        searchField: "canton",
        returnGeometry: false,
      });
      const data = await fetchJSON<FindResponse>(url);
      const stations = data.results.slice(0, 20).map(slimTrafficStation);
      return JSON.stringify({
        count: stations.length,
        total: data.results.length,
        canton,
        stations,
        source: "ASTRA — Federal Roads Office (Bundesamt für Strassen)",
      });
    }
  • The schema definition for the 'get_traffic_by_canton' tool, specifying the required 'canton' input parameter.
    {
      name: "get_traffic_by_canton",
      description:
        "List ASTRA traffic counting stations in a Swiss canton. Returns up to 20 stations with traffic data.",
      inputSchema: {
        type: "object",
        required: ["canton"],
        properties: {
          canton: {
            type: "string",
            description: "2-letter canton code (e.g. 'ZH', 'BE', 'GE', 'VS')",
          },
        },
      },
    },
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. It discloses the return limit ('up to 20 stations') and that traffic data is included, but lacks details on permissions, rate limits, data freshness, error handling, or pagination behavior. For a data-fetching tool with no annotations, 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences with zero waste: the first states the purpose and scope, and the second adds crucial behavioral detail (return limit and data type). It is front-loaded and efficiently structured.

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 no annotations and no output schema, the description is moderately complete for a simple query tool. It covers the core purpose and a key constraint (20-station limit), but lacks details on output format, error cases, or deeper behavioral context, leaving room for improvement.

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 fully documents the 'canton' parameter with examples. The description adds no additional parameter semantics beyond implying canton-based filtering, which is already covered. 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.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('List'), resource ('ASTRA traffic counting stations'), and scope ('in a Swiss canton'), with additional detail about what data is returned ('traffic data'). It distinguishes itself from sibling tools like 'get_traffic_count' or 'get_traffic_nearby' by specifying canton-based filtering.

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?

No explicit guidance is provided on when to use this tool versus alternatives like 'get_traffic_nearby' or 'list_snow_stations'. The description mentions canton-based filtering but does not clarify prerequisites, exclusions, or comparative use cases with other traffic-related tools.

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