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: {},
      },
    },

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