Skip to main content
Glama
kongyo2

Japanese Weather MCP Server

get_available_city_ids

Retrieve a list of city IDs for Japanese cities to access weather forecast data from the Japanese Weather MCP Server.

Instructions

Get a list of available city IDs for Japanese cities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_available_city_ids' tool. It iterates over CITY_IDS and formats a string listing all available city IDs.
    execute: async () => {
      let result = "๐Ÿ™๏ธ Available Japanese City IDs:\n\n";
    
      Object.entries(CITY_IDS).forEach(([name, id]) => {
        result += `${name}: ${id}\n`;
      });
    
      result += "\n๐Ÿ’ก You can use these IDs with the get_weather_forecast tool.";
      result +=
        "\n๐Ÿ“– For more city IDs, visit: https://weather.tsukumijima.net/primary_area.xml";
    
      return result;
    },
  • src/server.ts:91-113 (registration)
    Registration of the 'get_available_city_ids' tool using FastMCP's server.addTool method, including name, description, annotations, parameters schema, and inline handler.
    server.addTool({
      annotations: {
        openWorldHint: false, // This tool doesn't interact with external systems
        readOnlyHint: true, // This tool doesn't modify anything
        title: "Get Available City IDs",
      },
      description: "Get a list of available city IDs for Japanese cities",
      execute: async () => {
        let result = "๐Ÿ™๏ธ Available Japanese City IDs:\n\n";
    
        Object.entries(CITY_IDS).forEach(([name, id]) => {
          result += `${name}: ${id}\n`;
        });
    
        result += "\n๐Ÿ’ก You can use these IDs with the get_weather_forecast tool.";
        result +=
          "\n๐Ÿ“– For more city IDs, visit: https://weather.tsukumijima.net/primary_area.xml";
    
        return result;
      },
      name: "get_available_city_ids",
      parameters: z.object({}),
    });
  • Input schema for the tool, defined as an empty object using Zod (no parameters required).
    parameters: z.object({}),
  • Constant object CITY_IDS containing predefined city names and their corresponding IDs, used by the tool handler to generate the list of available cities.
    export const CITY_IDS = {
      // Fukuoka
      FUKUOKA: "400010",
      // Hiroshima
      HIROSHIMA: "340010",
      // Kawasaki
      KAWASAKI: "140020",
      // Kobe
      KOBE: "280010",
      // Kyoto
      KYOTO: "260010",
      // Nagoya
      NAGOYA: "230010",
      // Osaka
      OSAKA: "270000",
      // Sapporo
      SAPPORO: "016010",
      // Tokyo
      TOKYO: "130010",
      // Yokohama
      YOKOHAMA: "140010",
    } as const;
Install Server

Other Tools

Related 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/kongyo2/Japanese-Weather-MCP'

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