Create a Weather Agent

Build a custom agent from scratch

Build a Weather Agent that can look up any location and check current conditions and forecasts.

You need a Band account with your LLM provider API key (e.g., OpenAI) configured. If you haven’t set that up yet, see Setup Your Account.


What You’ll Build

A Weather Agent that:

  • Resolves any location name to coordinates using geocode_location_service
  • Gets current weather and forecasts using weather_forecast_service
  • Responds to natural language questions about weather anywhere in the world

Step-by-Step Guide

1

Create the Agent

  1. Navigate to Agents in the left sidebar
  2. Click Create New Agent
  3. Fill in the details:
FieldValue
NameWeather Agent
DescriptionChecks weather conditions for any location. Reports current conditions and forecasts up to 7 days.
ModelSelect a model (e.g., GPT-4o)
  1. Click Save

The agent is created with a default system prompt and communication tools (messaging, participant management) already attached.

2

Add the Weather Tools

Your agent needs two tools: one to resolve location names to coordinates, and one to fetch weather data.

  1. Open the Tools tab on the agent details page
  2. Click Add Existing Tool
  3. Select geocode_location_service and weather_forecast_service
  4. Click Save

Both tools are global and available to all accounts. geocode_location_service converts a location name (e.g., “San Francisco”) into latitude/longitude coordinates. weather_forecast_service uses those coordinates to return current conditions and up to 7 days of forecasts.

3

Use Your Agent

  1. Navigate to Chats in the left sidebar
  2. Create a new chat room
  3. Click the + icon in the participants panel and add Weather Agent
  4. Try these example messages:
@Weather Agent What's the weather in San Francisco?
@Weather Agent Will it rain in Seattle tomorrow?
@Weather Agent Check the weather in Miami for next Saturday

Your Weather Agent is live! It will geocode the location, fetch the forecast, and respond with the conditions.


What Just Happened?

You built a working agent in three steps:

  1. Created the agent with a name, description, and model
  2. Added tools that give the agent real capabilities (geocode_location_service and weather_forecast_service)
  3. Used it in a chat room via @mentions

The default system prompt already teaches the agent how to send messages, handle @mentions, and use whatever tools are attached. You didn’t need to write any prompt or code, just connect the tools.


Customization Ideas

Once your agent is working, you can edit the system prompt in the Prompts tab to fine-tune its behavior:

Add weather alerts: Tell it to proactively warn about severe weather, storms, or extreme temperatures when checking the forecast.

Add personality: Make it cheerful (“Great day for a walk!”) or formal (“Current conditions indicate…”).

Expand scope: Add instructions to suggest activities based on weather (“Perfect beach weather!”).


Troubleshooting

Check that both geocode_location_service and weather_forecast_service are listed in the agent’s Tools tab.

  • Use the event type filters at the top of the chat to filter for error events
  • Verify your LLM provider API key is defined and active in Settings
  • Confirm a model is selected on the agent details page

Weather lookups require multiple tool calls (geocode then forecast), which add latency. This is normal.


Next Steps

Now that you’ve built your first custom agent: