As mentioned earlier, we’re going to need two tools: one to access the data source of general weather information that we just created, and one to query the Open-Meteo API for real-time weather forecasts. We’ll create the former first.

Click “Tools” on the left sidebar. This will take you to a list of the existing tools for your org. You’ll notice that there are many existing already - this is because Syllable comes with a standard set of tools out of the box. To create a new one, click “New tool” in the top-right corner.

  • Name: The name of the tool is used to reference it elsewhere in Console, including in prompts and agents, so you should pick something that’s easily identifiable. It shouldn’t contain any whitespace. Enter “general_weather_information” here.

  • Service: A service is a grouping of tools. You can select any available service here to add your new tool to that service.

  • Tool schema: A JSON object defining the behavior and capabilities of the tool. For this tool, you can paste the following:

{
  "type": "endpoint",
  "endpoint": {
    "url": "http://helix-app/v1/search",
    "method": "post",
    "argumentLocation": "body"
  },
  "tool": {
    "type": "function",
    "function": {
      "name": "general_weather_information",
      "description": "Look up general weather information from data sources. Returns an answer and a reference URL. Do not include the reference URL in the spoken response.",
      "parameters": {
        "type": "object",
        "required": [
          "question"
        ],
        "properties": {
          "question": {
            "type": "string",
            "description": "A user inquiry about content in the agent’s documents, e.g., What are the causes of wind?"
          }
        }
      }
    }
  },
  "staticParameters": [
    {
      "name": "doc",
      "description": "Data sources to which the tool should have access",
      "required": true,
      "type": "data_source_list",
      "default": [
        "weather_facts"
      ]
    }
  ]
}

This tool will query Helix, Syllable’s document management and search service, for an answer to the user’s question, using the weather_facts data source that we created as its knowledge base. Click Save to save this tool.

Now we need to create our second tool to call the Open-Meteo API. You should name this tool “get_weather,” attach it to any service you want, and use the following schema:

{
  "type": "endpoint",
  "endpoint": {
    "url": "https://api.open-meteo.com/v1/forecast",
    "method": "get",
    "argumentLocation": "query"
  },
  "tool": {
    "type": "function",
    "function": {
      "name": "get_weather",
      "description": "Get the weather for a city",
      "parameters": {
        "type": "object",
        "properties": {
          "longitude": {
            "type": "number",
            "description": "The longitude of the city"
          },
          "latitude": {
            "type": "number",
            "description": "The latitude of the city"
          },
          "current": {
            "type": "string",
            "description": "information to retrieve from the open-meteo API, comma-separated",
            "default": "temperature_2m,relative_humidity_2m,precipitation,rain,showers,snowfall"
          }
        },
        "required": [
          "longitude",
          "latitude",
          "current"
        ]
      }
    }
  }
}

Click Save on this tool.

Now that we have our two tools, we can make them available to the prompt that we created earlier, so that any agents using that prompt will have access to the tools. We can do this on the prompt edit screen. Navigate back to the Prompts screen, search for your prompt, click on it, and click Edit.

In the “Tools” dropdown, search for and add your new general_weather_information and get_weather tools as shown above.

You also need to update the text of the prompt itself so that it informs the LLM when and how to use the new tools. Update it to match the following:

You are a weather agent. You can tell the user information about the current weather in a given city, and also answer general weather-related questions.

When asked about information for a city, call "get_weather" with the city information (longitude and latitude). You will reply with the current temperature and relative humidity level based on the response. Using the information on the response, also tell the caller the weather conditions in one simple sentence, like "sunny," or "rainy." If you can't determine the city coordinates with the information given, ask for more information.

When asked a general weather-related question, call "general_weather_information" with the question that the user asked you.

When asked about any other topic, don't answer and instead remind the caller that you are a weather agent. Keep the tone professional, friendly, and clear. You are chatting with a user, so always respond naturally and conversationally. Do not use non-verbal cues, describe system actions, or add any other information.

Now click Save to save the prompt.

We have one more step before we’re able to create the agent, and that’s to add a greeting message for the agent to deliver to the user at the beginning of a conversation. Click “Create a message” below to continue the tutorial.

(Full tools docs)