Skip to main content

:compass: Use case examples


Go to Spaces > Tools in your Dust workspace, click Add Tools, and select Val Town.

Authentication

Val Town’s REST API supports Bearer Token authentication. You can create and manage your Val Town API tokens on the API Tokens page. In order to use all available tools, the token will need read and write permissions for vals. Your Val Town API token must be stored as a Dust developer secret. Go to Admin -> Builder Tools Management -> Secrets, and select Create Secret to store your Val Town API token. Once the tool has been configured by the admin as described before, it can be selected on any agent. In the Agent Builder, simply click on Add Tool and select Val Town. You will be required to select a developer secret that will be used as a bearer token for all API calls.

Create Val

Creates a new val in Val Town. Use create_file to add files to the val.

Get Val

Gets a specific val by its ID

List Vals

Lists vals available to the user’s account

Search Vals

Searches for vals by name, description, or content

List Val Files

Lists all files in a specific val

Get File Content

Gets the content of a specific file in a val using the Val Town API

Delete File

Deletes a specific file from a val using the Val Town API

Update File Content

Updates the content of a specific file in a val. Note: To change file type (e.g., to HTTP), use the file_update tool instead.

Write File

The primary function for writing content to files and updating file metadata. Use this to add content, change file type, rename files, or move files. For HTTP type: return value from serve handler must be a response or a promise resolving to a response.

Create File

Creates a new empty file in an existing val. Use write_file to add content and set the file type.

Call Http Endpoint

Runs an HTTP val endpoint by getting the file’s endpoint link and making a request to it