Skip to main content
Glama

list_cantons

Retrieve all Swiss cantons and their official codes for data integration and geographic reference.

Instructions

List all Swiss cantons with their codes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for the 'list_cantons' tool, which returns a hardcoded list of Swiss cantons.
    case "list_cantons": {
      // ZEFIX /cantons and /legalForms endpoints require authentication (403).
      // Return hardcoded authoritative list instead.
      const cantons = [
        { code: "AG", name: "Aargau" }, { code: "AI", name: "Appenzell Innerrhoden" },
        { code: "AR", name: "Appenzell Ausserrhoden" }, { code: "BE", name: "Bern" },
        { code: "BL", name: "Basel-Landschaft" }, { code: "BS", name: "Basel-Stadt" },
        { code: "FR", name: "Fribourg" }, { code: "GE", name: "Geneva" },
        { code: "GL", name: "Glarus" }, { code: "GR", name: "Graubünden" },
        { code: "JU", name: "Jura" }, { code: "LU", name: "Lucerne" },
        { code: "NE", name: "Neuchâtel" }, { code: "NW", name: "Nidwalden" },
        { code: "OW", name: "Obwalden" }, { code: "SG", name: "St. Gallen" },
        { code: "SH", name: "Schaffhausen" }, { code: "SO", name: "Solothurn" },
        { code: "SZ", name: "Schwyz" }, { code: "TG", name: "Thurgau" },
        { code: "TI", name: "Ticino" }, { code: "UR", name: "Uri" },
        { code: "VD", name: "Vaud" }, { code: "VS", name: "Valais" },
        { code: "ZG", name: "Zug" }, { code: "ZH", name: "Zürich" },
      ];
      return JSON.stringify(cantons, null, 2);
    }
  • Definition and registration of the 'list_cantons' tool in the companiesTools array.
      name: "list_cantons",
      description: "List all Swiss cantons with their codes",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
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 states the tool lists cantons with codes, but doesn't disclose behavioral traits such as whether it's a read-only operation, if there are rate limits, how data is formatted, or if it requires authentication. This is a significant gap for a tool with no annotation coverage.

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 a single, efficient sentence that front-loads the key information ('List all Swiss cantons with their codes'). There is no wasted text, making it highly concise and well-structured for quick understanding.

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 (0 parameters, no output schema, no annotations), the description is adequate but has gaps. It explains what data is returned, but without annotations or output schema, it lacks details on behavior, format, or constraints. For a basic list tool, it meets minimum viability but could be more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description adds value by specifying what data is returned ('Swiss cantons with their codes'), which compensates for the lack of an output schema. This provides clear semantics beyond the empty schema.

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 verb ('List') and resource ('Swiss cantons'), making the purpose evident. It distinguishes from siblings by focusing on cantons rather than other Swiss data like municipalities or postcodes. However, it doesn't explicitly differentiate from 'list_postcodes_in_canton' or 'search_cantonal_affairs', which are related but distinct.

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 guidance is provided on when to use this tool versus alternatives like 'get_dams_by_canton' or 'list_postcodes_in_canton'. The description implies usage for retrieving canton data, but it lacks explicit context, prerequisites, or exclusions, leaving the agent to infer based on tool names alone.

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