Tool: lookup_weather
Retrieves comprehensive weather data including current conditions, hourly, and daily forecasts. Specific Data Available: Temperature (Current, Feels Like, Max/Min, Heat Index), Wind (Speed, Gusts, Direction), Celestial Events (Sunrise/Sunset, Moon Phase), Precipitation (Type, Probability, Quantity/QPF), Atmospheric Conditions (UV Index, Humidity, Cloud Cover, Thunderstorm Probability), and Geocoded Location Address. Location & Location Rules (CRITICAL): The location for which weather data is requested is specified using the 'location' field. This field is a 'oneof' structure, meaning you MUST provide a value for ONLY ONE of the three location sub-fields below to ensure an accurate weather data lookup. 1. Geographic Coordinates (lat_lng) * Use it when you are provided with exact lat/lng coordinates. * Example: "lat_lng": { "latitude": 34.0522, "longitude": -118.2437 } // Los Angeles 2. Place ID (place_id) * An unambiguous string identifier (Google Maps Place ID). * The place_id can be fetched from the search_places tool. * Example: "place_id": "ChIJLU7jZClu5kcR4PcOOO6p3I0" // Eiffel Tower 3. Address String (address) * A free-form string that requires specificity for geocoding. * City & Region: Always include region/country (e.g., "London, UK", not "London"). * Street Address: Provide the full address (e.g., "1600 Pennsylvania Ave NW, Washington, DC"). * Postal/Zip Codes: MUST be accompanied by a country name (e.g., "90210, USA", NOT "90210"). Usage Modes: 1. Current Weather: Provide address only. Do not specify date and hour. 2. Hourly Forecast: Provide address, date, and hour (0-23). Use for specific times (e.g., "at 5 PM") or terms like 'next few hours' or 'later today.'. If the user specifies minute, round down to the nearest hour. Hourly forecast beyond 48 hours from now is not supported. 3. Daily Forecast: Provide address and date. Do not specify hour. Use for general day requests (e.g., "weather for tomorrow", "weather on Friday", "weather on 12/25"). If today's date is not in the context, you should clarify it with the user. Daily forecast beyond 7 days including today is not supported. Historical weather is not supported. Parameter Constraints: * Timezones: All date and hour inputs must be relative to the location's local time zone, not the user's time zone. * Date Format: Inputs must be separated into {year, month, day} integers. * Units: Defaults to METRIC. Set units_system to IMPERIAL for Fahrenheit/Miles if the user implies US standards or explicitly requests it.
The following sample demonstrate how to use curl to invoke the lookup_weather MCP tool.
| Curl Request |
|---|
curl --location 'https://mapstools.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "lookup_weather", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request for the LookupWeather method - represents the weather conditions at the requested location.
LookupWeatherRequest
| JSON representation |
|---|
{ "DEPRECATEDAddress": string, "unitsSystem": enum ( |
| Fields | |
|---|---|
DEPRECATEDAddress |
DEPRECATED: Use location instead. |
unitsSystem |
Optional. The units system to use for the returned weather conditions. If not provided, the returned weather conditions will be in the metric system (default = METRIC). |
location |
Required. The location to get the weather conditions for. |
Union field
|
|
date |
Optional. The date of the required weather information. Note: This date is relative to the local timezone of the location specified in the location field. The date must be within the next 7 days. |
Union field
|
|
hour |
Optional. The hour of the requested weather information, in 24-hour format (0-23). This value is relative to the local timezone of the location specified in the location field. Hourly forecast is only supported for the next 48 hours from the current time. |
Date
| JSON representation |
|---|
{ "year": integer, "month": integer, "day": integer } |
| Fields | |
|---|---|
year |
Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. |
month |
Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. |
day |
Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. |
Location
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field location_type. Different ways to represent a location. location_type can be only one of the following: |
|
latLng |
A point specified using geographic coordinates. |
placeId |
The Place ID associated with the location . |
address |
Human readable address or a plus code. See https://plus.codes for details. |
LatLng
| JSON representation |
|---|
{ "latitude": number, "longitude": number } |
| Fields | |
|---|---|
latitude |
The latitude in degrees. It must be in the range [-90.0, +90.0]. |
longitude |
The longitude in degrees. It must be in the range [-180.0, +180.0]. |
Output Schema
Response for the LookupWeather RPC - represents the weather conditions at the requested location.
This response represent both Hourly and Daily information, therefore the response is split in three sections Hourly, Daily and Shared. Only-Hourly, Only-Daily fields are marked as optional. For fields that are shared between Hourly and Daily information, some are always present so they are not marked as optional while the rest are marked as optional because they are not always available.
LookupWeatherResponse
| JSON representation |
|---|
{ "weatherCondition": { object ( |
| Fields | |
|---|---|
weatherCondition |
The weather condition |
precipitation |
The precipitation probability and amount of precipitation accumulated |
wind |
The wind conditions |
DEPRECATEDGeocodedAddress |
DEPRECATED: Use returned_location instead. |
returnedLocation |
Required. The location where the weather information is returned. This location is identical to the location in the request, but can be different from it if the requested location is a free text address that looks up to a coarse location (e.g. "Mountain View, CA"). |
Union field
|
|
temperature |
The hourly temperature |
Union field
|
|
feelsLikeTemperature |
The hourly measure of how the temperature feels like. |
Union field
|
|
heatIndex |
The hourly heat index temperature. |
Union field
|
|
airPressure |
The hourly air pressure conditions. |
Union field
|
|
maxTemperature |
The maximum (high) temperature throughout the day. |
Union field
|
|
minTemperature |
The minimum (low) temperature throughout the day. |
Union field
|
|
feelsLikeMaxTemperature |
The maximum (high) feels-like temperature throughout the day. |
Union field
|
|
feelsLikeMinTemperature |
The minimum (low) feels-like temperature throughout the day. |
Union field
|
|
maxHeatIndex |
The maximum heat index temperature throughout the day. |
Union field
|
|
sunEvents |
The events related to the sun (e.g. sunrise, sunset). |
Union field
|
|
moonEvents |
The events related to the moon (e.g. moonrise, moonset). |
Union field
|
|
relativeHumidity |
The percent of relative humidity (values from 0 to 100). define optional because it is not always available |
Union field
|
|
uvIndex |
The maximum ultraviolet (UV) index. define optional because it is not always available |
Union field
|
|
thunderstormProbability |
The thunderstorm probability (values from 0 to 100). define optional because it is not always available |
Union field
|
|
cloudCover |
The percentage of the sky covered by clouds (values from 0 to 100). define optional because it is not always available |
Temperature
| JSON representation |
|---|
{ "unit": enum ( |
| Fields | |
|---|---|
unit |
The code for the unit used to measure the temperature value. |
Union field
|
|
degrees |
The temperature value (in degrees) in the specified unit. |
AirPressure
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field
|
|
meanSeaLevelMillibars |
The mean sea level air pressure in millibars. |
SunEvents
| JSON representation |
|---|
{ "sunriseTime": string, "sunsetTime": string } |
| Fields | |
|---|---|
sunriseTime |
The time when the sun rises. NOTE: In some unique cases (e.g. north of the artic circle) there may be no sunrise time for a day. In these cases, this field will be unset. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
sunsetTime |
The time when the sun sets. NOTE: In some unique cases (e.g. north of the artic circle) there may be no sunset time for a day. In these cases, this field will be unset. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
Timestamp
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). |
nanos |
Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive. |
MoonEvents
| JSON representation |
|---|
{
"moonriseTimes": [
string
],
"moonsetTimes": [
string
],
"moonPhase": enum ( |
| Fields | |
|---|---|
moonriseTimes[] |
The time when the upper limb of the moon appears above the horizon (see https://en.wikipedia.org/wiki/Moonrise_and_moonset). NOTE: For most cases, there'll be a single moon rise time per day. In other cases, the list might be empty (e.g. when the moon rises after next day midnight). However, in unique cases (e.g. in polar regions), the list may contain more than one value. In these cases, the values are sorted in ascending order. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
moonsetTimes[] |
The time when the upper limb of the moon disappears below the horizon (see https://en.wikipedia.org/wiki/Moonrise_and_moonset). NOTE: For most cases, there'll be a single moon set time per day. In other cases, the list might be empty (e.g. when the moon sets after next day midnight). However, in unique cases (e.g. in polar regions), the list may contain more than one value. In these cases, the values are sorted in ascending order. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
moonPhase |
The moon phase (a.k.a. lunar phase). |
WeatherCondition
| JSON representation |
|---|
{ "iconBaseUri": string, "description": { object ( |
| Fields | |
|---|---|
iconBaseUri |
The base URI for the icon not including the file type extension. To display the icon, append a theme if desired and the file type extension ( |
description |
The textual description for this weather condition (localized). |
type |
The type of weather condition. |
LocalizedText
| JSON representation |
|---|
{ "text": string, "languageCode": string } |
| Fields | |
|---|---|
text |
Localized string in the language corresponding to |
languageCode |
The text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. |
Precipitation
| JSON representation |
|---|
{ "probability": { object ( |
| Fields | |
|---|---|
probability |
The probability of precipitation (values from 0 to 100). |
snowQpf |
The amount of snow, measured as liquid water equivalent, that has accumulated over a period of time. Note: QPF is an abbreviation for Quantitative Precipitation Forecast (please see the QuantitativePrecipitationForecast definition for more details). |
qpf |
The amount of precipitation rain, measured as liquid water equivalent, that has accumulated over a period of time. Note: QPF is an abbreviation for Quantitative Precipitation Forecast (please see the QuantitativePrecipitationForecast definition for more details). |
PrecipitationProbability
| JSON representation |
|---|
{ "type": enum ( |
| Fields | |
|---|---|
type |
A code that indicates the type of precipitation. |
Union field
|
|
percent |
A percentage from 0 to 100 that indicates the chances of precipitation. |
QuantitativePrecipitationForecast
| JSON representation |
|---|
{ "unit": enum ( |
| Fields | |
|---|---|
unit |
The code of the unit used to measure the amount of accumulated precipitation. |
Union field
|
|
quantity |
The amount of precipitation, measured as liquid water equivalent, that has accumulated over a period of time. |
Wind
| JSON representation |
|---|
{ "direction": { object ( |
| Fields | |
|---|---|
direction |
The direction of the wind, the angle it is coming from. |
speed |
The speed of the wind. |
gust |
The wind gust (sudden increase in the wind speed). |
WindDirection
| JSON representation |
|---|
{ "cardinal": enum ( |
| Fields | |
|---|---|
cardinal |
The code that represents the cardinal direction from which the wind is blowing. |
Union field
|
|
degrees |
The direction of the wind in degrees (values from 0 to 360). |
WindSpeed
| JSON representation |
|---|
{ "unit": enum ( |
| Fields | |
|---|---|
unit |
The code that represents the unit used to measure the wind speed. |
Union field
|
|
value |
The value of the wind speed. |
Location
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field location_type. Different ways to represent a location. location_type can be only one of the following: |
|
latLng |
A point specified using geographic coordinates. |
placeId |
The Place ID associated with the location . |
address |
Human readable address or a plus code. See https://plus.codes for details. |
LatLng
| JSON representation |
|---|
{ "latitude": number, "longitude": number } |
| Fields | |
|---|---|
latitude |
The latitude in degrees. It must be in the range [-90.0, +90.0]. |
longitude |
The longitude in degrees. It must be in the range [-180.0, +180.0]. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ✅ | Open World Hint: ❌