Skip to main content
Glama

Japanese Weather MCP Server

example-usage.md•3.65 kB
# Weather MCP Server Usage Examples This document shows how to use the Japanese Weather MCP Server with various MCP clients. ## Configuration Add the following to your MCP client configuration: ```json { "mcpServers": { "weather": { "command": "node", "args": ["/path/to/weather-mcp-server/dist/server.js"], "env": {} } } } ``` ## Tool Usage Examples ### 1. Get Weather by City Name **Tool:** `get_weather_by_city_name` **Parameters:** ```json { "cityName": "TOKYO" } ``` **Expected Response:** ``` šŸŒ¤ļø Weather for Tokyo ę±äŗ¬ šŸ“… Published: 2024/01/15 05:00:00 šŸ“… Today: Weather: ę™“ć‚Œ Max Temp: 12°C Min Temp: 3°C Rain Chance: 0% (6-12h), 10% (12-18h) Details: ę™“ć‚Œ Wind: åŒ—ć®é¢Ø ``` ### 2. Get Available City IDs **Tool:** `get_available_city_ids` **Parameters:** None **Expected Response:** ``` šŸ™ļø Available Japanese City IDs: TOKYO: 130010 OSAKA: 270000 KYOTO: 260010 FUKUOKA: 400010 SAPPORO: 016010 NAGOYA: 230010 YOKOHAMA: 140010 KOBE: 280010 KAWASAKI: 140020 HIROSHIMA: 340010 šŸ’” You can use these IDs with the get_weather_forecast tool. šŸ“– For more city IDs, visit: https://weather.tsukumijima.net/primary_area.xml ``` ### 3. Get Weather by City ID **Tool:** `get_weather_forecast` **Parameters:** ```json { "cityId": "130010" } ``` **Expected Response:** ``` šŸŒ¤ļø Weather Forecast for Tokyo ę±äŗ¬ šŸ“… Published: 2024/01/15 05:00:00 šŸ¢ Office: 気豔庁 šŸ“… Today (今ꗄ): Weather: ę™“ć‚Œ Max Temp: 12°C Min Temp: 3°C Rain Chance: 0% (6-12h), 10% (12-18h) Details: ę™“ć‚Œ Wind: åŒ—ć®é¢Ø šŸ“… Tomorrow (ę˜Žę—„): Weather: ꛇ悊 Max Temp: 10°C Min Temp: 2°C Rain Chance: 20% (6-12h), 30% (12-18h) Details: ꛇ悊 Wind: åŒ—ę±ć®é¢Ø šŸ“… Day After Tomorrow (ę˜Žå¾Œę—„): Weather: 雨 Max Temp: 8°C Min Temp: 1°C Rain Chance: 70% (6-12h), 80% (12-18h) Details: 雨 Wind: ę±ć®é¢Ø ``` ## Prompt Usage ### Weather Forecast Request **Prompt:** `weather-forecast` **Parameters:** ```json { "location": "Tokyo" } ``` **Expected Response:** ``` Please provide weather information for Tokyo. You can use the following tools: 1. get_weather_by_city_name - for common Japanese cities 2. get_weather_forecast - for any city using its ID 3. get_available_city_ids - to see available city options If you need a specific city ID, you can check the available options first. ``` ## Error Handling The server handles various error scenarios: 1. **Invalid City ID:** ``` Error fetching weather data: HTTP error! status: 404 ``` 2. **Network Issues:** ``` Error fetching weather data: Failed to fetch weather data: Network error ``` 3. **Invalid City Name:** ``` City 'INVALID_CITY' not found. Available cities: TOKYO, OSAKA, KYOTO, FUKUOKA, SAPPORO, NAGOYA, YOKOHAMA, KOBE, KAWASAKI, HIROSHIMA ``` ## Rate Limiting Remember to respect the API rate limits: - Use a custom User-Agent header (already implemented) - Avoid rapid successive requests - Maintain at least 0.5-second intervals between requests ## Integration Examples ### With Claude Desktop 1. Add the server configuration to your Claude Desktop settings 2. Restart Claude Desktop 3. Use natural language to request weather information: - "What's the weather in Tokyo?" - "Show me the forecast for Osaka" - "Get weather information for Kyoto" ### With Other MCP Clients The server follows the MCP specification and should work with any compliant client. The tools provide structured access to Japanese weather data with proper error handling and rate limiting.

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