Weather Outlook
A plain 5 to 7 day forecast for one place, with each day's icon, high and low. No hours, wind or alerts.
Pattern · Shares patterns with Weather
≈ 879 tokens per use (tool 486 · guidance 182 · typical payload 211)How token costs are estimated
Example: Weather Outlook
What's the weather like in Lisbon this week?
Lisbon
7-day forecast · °C
Rain midweek, then dry and sunny for the weekend.
- Today: Partly cloudy, high 22°, low 15°
- Tomorrow: Cloudy, high 21°, low 14°, 20% chance of precipitation
- Wednesday: Rain, high 19°, low 14°, 70% chance of precipitation
- Thursday: Rain, high 18°, low 13°, 60% chance of precipitation
- Friday: Partly cloudy, high 20°, low 13°
- Saturday: Clear, high 22°, low 12°
- Sunday: Clear, high 23°, low 13°
When to use
- The user asks what the weather will be like over the next several days, with no detail asked for.
- A weather tool returned a daily forecast for that place.
When not to use
- The question is about today's hours, wind, alerts or what to wear right now. Use Weather.
- You don't have a forecast from a tool. Never invent or recall readings.
- The user compares many places at once. Use a Data Table.
How the agent should use it
- Send 5 to 7 days in date order, copied from the tool result unchanged, in the units it returned. Set
unitsto match. - Add
summaryonly when it says something the icons don't, in one short sentence. - Pass
asOfandtimezoneso the first day reads "Today" and the rest show their weekday.
What it shows
Each day is a name, a weather icon, a high and a low, plus the chance of precipitation when it is 20% or more. Today is marked. On a wide card the days sit side by side in columns; on a narrow one they stack as rows.
Icons
The days use an illustrated icon set, one PNG per condition with a light-mode and a dark-mode file (clear-day.png, clear-day-dark.png, and so on). They live in public/weather-icons/ and are shared through weather-icon.tsx, so changing that one file swaps the set. Registry installs can't carry image files: copy the weather-icons folder into your public/ directory, or replace the icons in weather-icon.tsx with your own.
Accessibility
The visual days are decorative. A visually hidden list carries the same readings, one sentence per day ("Wednesday: Rain, high 19°, low 14°, 70% chance of precipitation").
Installation
npx shadcn@latest add https://your-site.com/r/weather-outlook.json
Usage
import { tool } from "ai"
import { weatherOutlookTool } from "@/components/genui/weather-outlook.schema"
const tools = {
[weatherOutlookTool.name]: tool({
description: weatherOutlookTool.description,
inputSchema: weatherOutlookTool.inputSchema,
}),
}import { WeatherOutlook } from "@/components/genui/weather-outlook"
function ToolPart({ part }) {
if (part.type !== "tool-show_weather_outlook") return null
return (
<WeatherOutlook
{...part.input}
status={part.state === "input-streaming" ? "streaming" : undefined}
/>
)
}It is display-only: nothing is sent back to the agent.
Schema
| Prop | Type | Notes |
|---|---|---|
location | { name, region? } | Data-bound |
asOf | string | ISO date-time; labels Today |
timezone | string | IANA, e.g. Europe/Lisbon |
units | "metric" | "imperial" | °C or °F |
days | Day[] | 5–7 days, in date order. Data-bound |
summary | string? | One short sentence, up to 120 characters |
Day
| Field | Type | Notes |
|---|---|---|
date | string | Local date, e.g. 2026-11-14 |
min, max | number | Low and high |
condition | clear | partly-cloudy | cloudy | fog | drizzle | rain | heavy-rain | thunderstorm | snow | sleet | wind | Picks the icon |
precipChance | number? | Percent. Shown from 20 |
Host props: status (streaming, ready) and className.