> ## Documentation Index
> Fetch the complete documentation index at: https://explore.airia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate MongoDB Tools

This guide walks you through configuring and authenticating the MongoDB tools in Airia, enabling your agents to interact with your MongoDB database.

Airia provides the following MongoDB tools:

* **MongoDB Find:** To search for documents within your MongoDB collections.
* **MongoDB Aggregate:** To perform aggregation operations on a collection.
* **MongoDB Metadata:** To retrieve schema metadata for your MongoDB database.

All three tools are essential for comprehensive interaction with your MongoDB database.

## Prerequisites

To connect Airia to your MongoDB server, you will need the following details:

* **Hostname/Endpoint**
* **Port** (default: `27017`)
* **Database name**
* **Basic Credentials:**
  * **User name**
  * **Password**

> 💡 Note: These details can be retrieved from your MongoDB server configuration.

## Add and Configure MongoDB Tools

Follow these steps to add and configure each MongoDB tool:

1. **Add a MongoDB Tool:**
   * Navigate to the **Tools** section in your Airia dashboard.
   * From the library, select the MongoDB tool you wish to add (e.g., **MongoDB Find**, **MongoDB Aggregate**, or **MongoDB Metadata**).

2. **Provide Connection Details:**
   * On the tool configuration page, provide the following details:
     * **Hostname/Endpoint:** Your MongoDB server's hostname or IP address.
     * **Port:** The port number your MongoDB server is listening on (default `27017`).
     * **Database name:** The name of the database you want to connect to.
   * For **User name** and **Password**, set them as a **Basic authentication credential**.

3. **Save the Tool:**
   * Click **Save** to add the configured tool to your library.

4. **Repeat for Other Tools:**
   * Repeat steps 1-3 for the **MongoDB Aggregate** tool.
   * Repeat steps 1-3 for the **MongoDB Metadata** tool.

## Next Steps

Now that your MongoDB tools are added, you can integrate them into an agent to query your MongoDB database.

* [Use MongoDB tools in an Agent](./using-database-tools-in-agents.mdx)

> ⚠️ Warning: Your MongoDB server must be accessible by Public IP. If you encounter connectivity issues, contact [support@airia.com](mailto:support@airia.com). We can provide you with the necessary IP addresses to whitelist on your firewall.
