> For the complete documentation index, see [llms.txt](https://docs.wisej.com/ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/ai/components/api/tools/wisej.ai.tools.utilitytools.md).

# UtilityTools

Namespace: **Wisej.AI.Tools**

Assembly: **Wisej.AI** (3.5.0.0)

* [ToolsContainer](/ai/components/api/tools/wisej.ai.tools.toolscontainer.md)
  * [UtilityTools](/ai/components/api/tools/wisej.ai.tools.utilitytools.md)

Represents a collection of utility tools that provide various functionalities such as retrieving the current date and time, and obtaining the user's location.

{% tabs %}
{% tab title="C#" %}

```csharp
public class UtilityTools : ToolsContainer
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class UtilityTools
    Inherits ToolsContainer
```

{% endtab %}
{% endtabs %}

This class extends the `ToolsContainer` and includes methods that can be used to perform common utility operations.

## Constructors

### ![](/files/ptrKjmmRoQB76pvrIqh0) UtilityTools()

Initializes a new instance of the [UtilityTools](/ai/components/api/tools/wisej.ai.tools.utilitytools.md) class.

## Methods

### ![](/files/KL0Ik37djZRr8a07Wopd) Finalize()

Finalizes an instance of the [UtilityTools](/ai/components/api/tools/wisej.ai.tools.utilitytools.md) class.

This destructor ensures that the `Geolocation` resource is properly disposed of when the `UtilityTools` object is garbage collected.

### ![](/files/KL0Ik37djZRr8a07Wopd) get\_current\_date\_time()

Retrieves the current date and time formatted as a long date and time string.

**Returns:** [String](https://docs.microsoft.com/dotnet/api/system.string). A string representing the current date and time.

This method returns the current date and time adjusted to the client's time zone.

### ![](/files/KL0Ik37djZRr8a07Wopd) get\_user\_location()

Asynchronously retrieves the user's current location as a JSON object.

**Returns:** [Task\<String>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1). A task that represents the asynchronous operation. The task result contains a JSON string of the user's location.

This method uses the `Geolocation` service to obtain the user's current position and returns it as a JSON string.

## Implements

| Name                                                                          | Description                                                                                           |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| [IToolsContainer](/ai/components/api/tools/wisej.ai.tools.itoolscontainer.md) | Represents a container for tools, providing access to a hub, adapter, and a collection of parameters. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/ai/components/api/tools/wisej.ai.tools.utilitytools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
