Skip to content

Commit 7501299

Browse files
committed
✨ Add temperature unit to weather tool
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
1 parent 1747575 commit 7501299

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

mcp/weather_tool/weather_tool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ def get_weather(city: str) -> str:
1616
return "City not found"
1717
latitude = data["results"][0]["latitude"]
1818
longitude = data["results"][0]["longitude"]
19-
19+
2020
weather_url = "https://api.open-meteo.com/v1/forecast"
2121
weather_params = {
2222
"latitude": latitude,
2323
"longitude": longitude,
24+
"temperature_unit": "celsius",
2425
"current_weather": True
2526
}
2627
weather_response = requests.get(weather_url, params=weather_params)
@@ -34,7 +35,7 @@ def run_server():
3435
transport = os.getenv("MCP_TRANSPORT", "streamable-http")
3536
host = os.getenv("HOST", "0.0.0.0")
3637
port = int(os.getenv("PORT", "8000"))
37-
mcp.run(transport=transport, host=host, port=port)
38+
mcp.run(transport=transport, host=host, port=port)
3839

3940
if __name__ == "__main__":
4041
run_server()

0 commit comments

Comments
 (0)