Skip to main content

Build a Weather Tool for AI Assistants

This playbook walks through creating a weather tool that AI assistants can discover and call via MCP.

For general setup, connecting clients, and authentication, see the MCP Server guide.

Create the Weather Tool

Open the Qaynaq UI, click Create New Flow, and configure each section:

Input - select MCP Tool

FieldValue
Nameget_weather
DescriptionGet current weather for a city
Input Parameterscity (string, required) - "City name"

Processor - select Mapping

For this example, we return a random temperature. In practice, you would call an external API or use other processors.

FieldValue
Mappingroot.temperature = random_int(min:0, max:40).string() + "C" / root.city = this.city

Output

The output is automatically set to Sync Response and locked when using MCP Tool input.

Click Save and then Start the flow.

Test the Tool

Once the flow is running, the get_weather tool appears automatically on the /mcp endpoint. You can verify it by asking your AI assistant something like "What's the weather in London?" and it will call the tool.

See MCP Server - Verify with curl for testing via the command line.