> ## Documentation Index
> Fetch the complete documentation index at: https://www.bolna.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetching Dynamic Date and Time with Bolna Voice AI

> Learn how to configure Bolna Voice AI to fetch the real-time date and time for any timezone specified by the user during a live conversation.

This guide will show you how to create a flexible tool for your Bolna Voice AI agent that can retrieve the current date and time from anywhere in the world. By using a dynamic parameter for the timezone, your agent can intelligently respond to user queries like "What time is it in Paris?".

We will use WorldTimeAPI, a free service that requires no API key or backend setup. The entire configuration is done within a single JSON object.

### Complete JSON Payload

Add the following JSON object to your Bolna agent's custom tools configuration.

```json  theme={"system"}
{
  "name": "getcurrentdatetime",
  "description": "Fetches the current date and time for a specific timezone. Use this when a user asks for the time, especially if they mention a city, country, or region.",
  "pre_call_message": "Just a moment, I'm getting the local time for you.",
  "parameters": {
    "type": "object",
    "properties": {
      "timezone": {
        "type": "string",
        "description": "The timezone to get the current time for, in 'Area/Location' format like 'America/New_York' or 'Europe/London'. If the user does not specify a timezone, default to 'Etc/UTC'."
      }
    }
  },
  "key": "custom_task",
  "value": {
    "method": "GET",
    "param": {},
    "url": "http://worldtimeapi.org/api/timezone/%(timezone)s",
    "api_token": null,
    "headers": {}
  }
}
```

<br />

### Configuration Properties

| Property                 | Description                                                                                                                                                                                          |
| :----------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Description**          | A detailed description that guides the LLM to use the function for timezone-specific queries. <br />**Try to make it as descriptive as possible for the LLM to execute this function successfully**. |
| **Timezone (parameter)** | This parameter is defined for the LLM. Its description guides the AI on the required `Area/Location` format and provides a default (`Etc/UTC`) if the user doesn't specify a location.               |
| **URL**                  | The API endpoint that includes a `%(timezone)s` placeholder. **Bolna automatically substitutes this placeholder** with the value of the `timezone` parameter before making the API call.             |
| **Timezone List**        | You can find a **[full list of valid timezones here](http://worldtimeapi.org/timezones)** to understand the format required by the API.                                                              |


Built with [Mintlify](https://mintlify.com).