Skip to main content
With the Val Town tool, your agents can find, create, and edit vals, the serverless TypeScript and JavaScript functions of Val Town, and run their HTTP endpoints. Vals can be HTTP endpoints, scripts, email handlers, or scheduled tasks. An admin adds Val Town once and stores a Val Town API token as a secret, then people pick that secret when they add Val Town to an agent.

What your agent can do in Val Town

The list in Dust is the source of truth, and it can change before this page does. To see every Val Town tool, go to Spaces > Tools, select Val Town, and open Tools & stakes.

Before you start

  • In Dust: you need to be an admin to add Val Town and store the secret.
  • In Val Town: you need an API token with read and write permissions on vals. Create it on the Val Town API tokens page. Agents act as the Val Town account that owns the token.

Set up Val Town

Only workspace admins can add Val Town.
1

Store your token as a secret

Go to Admin > Developers > Secrets and create a secret with your Val Town API token as its value.
2

Add the tool

Go to Spaces > Tools, click Add tools, and select Val Town. Leave the optional API Key field empty: the Val Town tools use the secret you pick for each agent instead.

Add Val Town to an agent

1

Open your agent in the Agent Builder

Create an agent, or open one you can edit.
2

Add the tool

In Capabilities and knowledge, click Add capabilities and select Val Town.
3

Pick the secret

Under Select a secret, pick the secret that holds your Val Town API token. The agent uses it for every Val Town request, for everyone who uses the agent.
4

Say what the agent can change

In the instructions, say which vals the agent can edit, and whether it can call HTTP endpoints on its own.
By default, finding vals and listing their files run without asking (Never ask), and every other tool is at Low, including reading the content of a file. Admins can change the level of each tool in Spaces > Tools > Val Town > Tools & stakes:
  • High: needs explicit user approval.
  • Low: users can completely disable confirmations.
  • Never ask: runs automatically.

Example instructions

Computer

Let your agents run code in a temporary workspace inside Dust.

Tools

All the tools your agents can use.