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

# Creating A Custom Tool To Save Users Address

## Background and Purpose

This SOP provides a step-by-step guide to creating a custom tool in an AI assistant for collecting and saving client addresses. This setup enables address information (street, city, state, postal code) to be saved directly in the General Info section of the contact profile, ensuring streamlined data entry for clients requesting roof inspections.

> **Note:** Since the update of Version 2.1, a custom tool like this should not be needed since there is a pre-built tool with the same functionality. However, we felt it would still be helpful to have this documentation so that users can learn how to build the tool themselves.

<img src="https://mintcdn.com/buildassistants-9ea2341f/ND7fhV-2lgrsOB5z/images/save-user-address.png?fit=max&auto=format&n=ND7fhV-2lgrsOB5z&q=85&s=e1e7b3f58b241933bbef050d4cba5de4" alt="Main dashboard interface" height="300" className="rounded-lg" data-path="images/save-user-address.png" />

## Resources Required

* **AI Assistant Dashboard** - Access to custom tool creation and assistant configurations
* **CRM System** (e.g., GoHighLevel) - Access to automation workflows and the contact profile fields
* **Endpoint URL** - Generated from an inbound webhook within the CRM

## Definition of Done

The setup is complete when:

* ✅ **Custom Tool:** A "Save Address" custom tool is created and linked to the assistant
* ✅ **Workflow Automation:** A workflow is created to map the address fields in the CRM
* ✅ **Testing:** The AI assistant successfully collects and saves the address to the appropriate fields in the contact profile

## Step-by-Step Process

### 1. Create the Custom Tool in AI Assistant Dashboard

#### Open AI Assistant Dashboard

1. Go to **Assistants** in the AI dashboard and select the assistant you want to configure
2. Under **Custom Tools**, click **Create a Custom Tool**

#### Define the Custom Tool

* **Unique Name:** Enter a descriptive name like "Save Address"
* **Description:** Add a detailed description (e.g., "Use this tool to collect and save the user's complete address including street, city, state, and zip code.")
* **Parameters:** Add these fields:
  * `street`
  * `city`
  * `state`
  * `zip_code`
* **Example Data:** For parameters, use an example address like "54 State Street, Albany, New York, 12207" for clarity

### 2. Generate Endpoint URL Using Inbound Webhook

#### Open a second tab for CRM Automations and follow these steps:

1. Go to **Automations** and create a new workflow titled **Save Address Webhook**

#### Add Trigger

1. Set **Inbound Webhook** as the trigger
2. Copy the **Webhook URL** generated by the inbound webhook

#### Link Webhook to Custom Tool

1. Return to the AI assistant's **Custom Tool** setup
2. Paste the **Webhook URL** in the endpoint field
3. Test by clicking on the arrow to verify with a green checkmark
4. **Save** and **Add Custom Tool to Assistant**

### 3. Add Prompt in AI Assistant to Collect Address

In the AI assistant's **Prompts** section:

1. Add a prompt instructing the assistant to ask the user for their full address (e.g., "Could you please provide your full address, including the zip code?")
2. Configure the assistant to call the **Save Address** function once the address is collected

### 4. Create Workflow to Map Address Fields in CRM

#### Return to the CRM Automation Tab

Use the workflow titled **Save Address Webhook**.

#### Fetch Sample Request

1. In the automation settings, select **Fetch Sample Request** to pull sample data
2. When the data mapping reference appears, save the trigger

#### Map Address Data to Contact Fields

1. **Delete Default Action** (e.g., Create Contact) if it appears automatically

2. **Add Find Contact Action:**
   * Choose **Find Contact by Contact ID**
   * Use the **Contact\_ID** with the underscore (e.g., `contact_id`) from the inbound webhook trigger

3. **Add Field Mapping for Address:**
   * Select **Update Contact Field** for each part of the address:

     **Street Address:**

     * Go to Inbound Webhook > Arguments > Street

     **City:**

     * Go to Inbound Webhook > Arguments > City

     **State:**

     * Go to Inbound Webhook > Arguments > State

     **Postal Code:**

     * Go to Inbound Webhook > Arguments > Zip Code

#### Save and Publish Workflow

* Save the workflow and publish it to activate the custom tool

### 5. Testing and Validation

#### Test the Assistant Workflow

1. Place a test call or interaction with the AI assistant
2. Provide the address details when prompted by the assistant
3. Confirm that the assistant verifies and confirms the address

#### Review Data in CRM

1. After the test interaction, go to the **Contacts** tab in the CRM
2. Confirm that the address has been correctly saved in the **General Info** section of the contact profile under Street Address, City, State, and Postal Code

## Implementation Example

### Address Collection Flow

1. **User Interaction:** "I'd like to schedule a roof inspection"
2. **AI Response:** "I'd be happy to help you schedule a roof inspection. Could you please provide your full address, including the zip code?"
3. **User Provides:** "123 Main Street, Springfield, Illinois, 62701"
4. **AI Processing:** Calls Save Address tool with parsed parameters:
   ```json theme={null}
   {
     "street": "123 Main Street",
     "city": "Springfield", 
     "state": "Illinois",
     "zip_code": "62701"
   }
   ```
5. **CRM Update:** Address automatically saved to contact profile

## Key Benefits

* ✅ **Automated data entry** eliminates manual address input
* ✅ **Standardized format** ensures consistent address storage
* ✅ **Real-time processing** with immediate CRM updates
* ✅ **Error reduction** through structured data collection
* ✅ **Seamless integration** with existing CRM workflows
* ✅ **Scalable solution** adaptable to other data collection needs

## FAQs

### What if the address data doesn't save in the correct fields?

**A:** Ensure that each address component (street, city, state, zip code) is mapped correctly in the Update Contact Field action.

### Can this process be adapted for other data fields?

**A:** Yes, modify the tool parameters and field mappings to capture other information (e.g., email, phone).

### What if the assistant does not capture the address correctly?

**A:** Check that the custom tool is added to the assistant and the prompt is correctly set to call the tool after collecting the address.

## Troubleshooting

**Tool not triggering:**

* Verify custom tool is linked to assistant
* Check prompt configuration for tool activation
* Test webhook endpoint connectivity

**Data not mapping correctly:**

* Review field mapping in workflow actions
* Ensure parameter names match webhook arguments
* Test with sample data to verify mapping

**Webhook errors:**

* Confirm webhook URL is correct and accessible
* Check authentication requirements
* Verify CRM permissions for contact updates

## Summary

This SOP explains setting up a custom tool in an AI assistant to collect and save client addresses for roof inspection appointments. Steps include creating the tool, configuring the webhook, mapping fields to the contact profile, and testing the setup. This setup ensures that address data is saved accurately for streamlined client scheduling and notification processes.
