Skip to content
ChatJS
Esc
navigateopen⌘Jpreview
On this page

Get Weather

Fetch current temperature and forecast data for coordinates

Installation

Start in a ChatJS app with chat.config.ts and components.json. No API key is configured by this item. It calls the Open-Meteo forecast endpoint.

npx @chat-js/cli@latest add get-weather

The command installs the server tool, renderer, and registration descriptor under tools/chatjs/get-weather/, along with required dependencies and shared renderer helpers. It then regenerates the app’s tool registrations.

Usage

Ask your chat model: “Get the weather at latitude 51.5074, longitude -0.1278.” Use a model that supports tool calling.

The tool accepts numeric latitude and longitude values. It requests current temperature, hourly temperatures, and daily sunrise and sunset times, with the timezone determined by the provider.

Behavior and limitations

This item does not geocode place names. Supply coordinates when verifying it. The implementation forwards provider JSON without runtime response validation.

Customize

Edit the installed tool.ts and renderer.tsx to change behavior or presentation. See Installation for updates and sync, and Authoring Tools to publish your own item.

Last updated on Sep 9, 2026

Was this page helpful?