> For the complete documentation index, see [llms.txt](https://docs.fastn.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fastn.ai/classic/fastn-ucl/getting-started/about-unified-context-layer/creating-a-custom-tool.md).

# Creating a Custom Tool

### **Step 1: Start from UCL Setup**

* Go to the **Connect** section in your UCL Workspace.

<figure><img src="/files/iRY5lD99iyDpkczghO6l" alt=""><figcaption></figcaption></figure>

* Click **“Define a Custom App”** to launch the **App Builder Assistant** chat.

<figure><img src="/files/8OYT4NrkeT8kCkNEDt6g" alt=""><figcaption></figcaption></figure>

### **Step 2: Create a Tool via Prompt**

Type a natural language prompt like:

> *“Create a tool for Google Cloud Storage.”*

The assistant may detect existing tooland ask where to add this app. For example:

> *Would you like to add the Google Cloud Storage tool under one of these, or shall I create a new group (e.g., “GoogleCloudStorage” with OAuth2 authentication)?*

You respond:

> *“Create a new group.”*

<figure><img src="/files/5vhFvk7VMkWepnDN50lT" alt=""><figcaption></figcaption></figure>

ℹ️ **Want to add to an existing tool instead?**\
Click **“Add to Existing Tool”** and select the tool you'd like to edit or extend with new toolkits.

<figure><img src="/files/BbKRFmHLrg9L482K8bGV" alt=""><figcaption></figcaption></figure>

### **Step 3: Confirm OAuth2 Authentication Setup**

The assistant will suggest an OAuth2 setup for the new tool:

```json
{
  "baseUrl": "https://accounts.google.com/o/oauth2/auth",
  "clientId": "",
  "secret": "",
  "params": {
    "scope": "https://www.googleapis.com/auth/devstorage.read_write",
    "response_type": "code",
    "access_type": "offline",
    "prompt": "consent"
  },
  "requiredAttributes": [],
  "tenantId": "default",
  "authorization": {
    "oauthGrantType": "authCodeGrantWithGrantType",
    "accessTokenUrl": "https://oauth2.googleapis.com/token",
    "refreshTokenGrantType": "refreshTokenWithAccessType"
  }
}
```

Confirm when prompted:

> *“Yes.”*

The assistant will respond:

> *“The ‘GoogleCloudStorage’ group is ready.”*

<figure><img src="/files/y9Dmt3cubkTjePAS3GaI" alt=""><figcaption></figcaption></figure>

### **Step 4: Add Actions to the Tool**

The assistant will suggest actions to expose:

> *Which GCS operation would you like to expose first as a tool? For example:*

* `listBuckets`
* `getBucketMetadata`
* `createBucket`
* `deleteBucket`
* `listObjects`
* `uploadObject`
* `downloadObject`
* `deleteObject`

You can respond:

> *“Add createBucket and listObjects.”*

You’ll then receive:

> *The tools “createBucket” and “listObjects” have been created successfully in the “GoogleCloudStorage” group. You can now use them in your workflows.*

<figure><img src="/files/HQzTMCowdi8PAjRRsXwZ" alt=""><figcaption></figcaption></figure>

### **Step 5: Finalize Setup in the Tools Section**

* Navigate to the **Tools** section in your UCL project.
* Under **Workspace Tools**, find the newly created **GoogleCloudStorage** group.

<figure><img src="/files/6cxIvd8sBlqqwk9eKSSt" alt=""><figcaption></figcaption></figure>

* Click the **three dots menu** > **Edit**, and fill in the `clientId` and `secret` using your Google Cloud credentials.
* Save the configuration.

<figure><img src="/files/IPGqXz1wpQtwPG04cfLM" alt=""><figcaption></figcaption></figure>

### **Step 6: Connect and Test with AI Agent**

* Now go back to the **Setup** section.
* Search for your **GoogleCloudStorage** tool group and **Connect** the app by authenticating your Google account.

<figure><img src="/files/JER8AKWlGedPHQ3bVYfo" alt=""><figcaption></figcaption></figure>

* Once connected, select any of the added actions (like `createBucket` or `listObjects`).

<figure><img src="/files/pz9ql8LEufN3DM30htgc" alt=""><figcaption></figcaption></figure>

* Use the AI Agent to test your tool with a natural command:

  > *“Create a bucket in my Google Cloud Storage.”*

#### Additional Prompt Ideas for creating Custom Tool

* “Create a tool for a fitness tracking app like Strava.”
* “Build a tool that pulls ticket data from our in-house Jira instance.”
* “Set up a custom tool for a REST API with POST and GET methods.”


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.fastn.ai/classic/fastn-ucl/getting-started/about-unified-context-layer/creating-a-custom-tool.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
