> 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

UCL lets you easily build your own custom tool groups using natural language.

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

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

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-1baf5a9bd64f03bd6ed2f97349a96a8ab1798001%2Fimage%20(522).png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-6e5546e70f1880139fa801dbe55722ddee0641a1%2Fimage.png?alt=media" 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="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-fc769b30fcce1c3a3d7679e47186861675115620%2Fimage.png?alt=media" 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="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-9b9195160e5360f4106491c195096e1c5cddd64e%2Fimage.png?alt=media" 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="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-1219bae308578970b17fad4017b7982c2bf87eef%2Fimage.png?alt=media" 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="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-e92d93823bb2b6c38d708d12e6c2d745858f62de%2Fimage.png?alt=media" 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="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-c90656f2e7ed59026a2274a2d28f58e5ce559d0e%2Fimage.png?alt=media" 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="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-e6bf21f5d087778e82e2f2a86b33db4344ad4c07%2Fimage.png?alt=media" 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="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-b649457ecc73bdb230689d137aebfaeb62858652%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-a2c22d5c2370e41faf993d81dbd52b13c237c229%2Fimage.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
