Skip to content
Talk to an engineer

Build actions

Agent Builder

The Agent Builder is the recommended way to build what your Product Agent can do inside your product: actions and the code behind them, task agents, navigation routes, and the cards the agent draws in chat. It runs in your coding tool (Claude Code, Codex, or Cursor). You describe the experience you want. The builder opens your app in a local browser, puts the agent on your page, writes the code, tests it by talking to the agent, and creates the actions and task agents in your Foldspace account.

You don’t need to be a developer. The builder runs the commands; your part is to sign in, talk to the agent, and say yes or no when it asks.

Agent Builder (recommended)Agent Studio
You work inClaude Code, Codex, or CursorThe Foldspace dashboard
You describeThe experience, in your own words: “show a customer’s open deals”Each action’s name, instructions, and input schema, field by field
The code behind each actionWritten, loaded, and tested for you against your real appWritten by your developers and registered in your app
You end withA working experience you have tried on your own pageAction definitions, ready for code

To build by hand instead, start with Authoring actions, Defining inputs, and Task Agents, then wire the code with Connect actions.

PartWhat it doesWhere it lives
The start promptTells your coding tool to set up Foldspace and then keep buildingfoldspace.ai/start
The setup playbookConnects the Foldspace tools, confirms your account and agent, picks a folder, and creates the projectfoldspace.ai/agents.md
Foldspace MCP serverGives your coding tool your agent: its actions, task agents, navigation routes, and conversation startershttps://api.foldspace.ai/mcp (sign in with your Foldspace account)
Foldspace Docs MCP serverSearch over these docs, so your coding tool checks how Foldspace behaves instead of guessinghttps://docs.foldspace.ai/mcp (no sign-in)
The projectA folder on your computer, named foldspace-<agent-key>, holding the code behind your actions and the build manualCreated from the @foldspace_npm/harness package
The Claude Code pluginInstalls both MCP servers in one stepfoldspace-agent-builder

The build rules your coding tool follows ship inside the project, in node_modules/@foldspace_npm/harness/CLAUDE.md. The project’s own CLAUDE.md (Claude) or AGENTS.md (Codex, Cursor) points to it, so every coding tool works from the same manual, and upgrading the project upgrades the rules.

Most builds start where sign-up ends.

  1. Sign up and name your product. Foldspace creates your agent and discovers the key use cases for your product. The use cases are saved to your agent, so the builder reads them later through the Foldspace MCP server.

  2. On the “You’re all set.” screen, choose your tool. Under Start building with, click Claude Code, Codex, or Cursor. The screen also lists how many use cases were found, with a link to open them. Prefer to paste? Click Copy prompt.

  3. Press Enter. Your coding tool opens a new session with the prompt typed in, and nothing runs until you send it. In an empty folder you made for your agent, it sets up right there. Anywhere else, it creates a new folder, or reuses the one it made for this agent before. It never sets up inside another project or git repository.

  4. Sign in to Foldspace. The builder connects to Foldspace through the Foldspace MCP server and opens Foldspace’s sign-in page in your browser. Sign in with your Foldspace account. This one sign-in lets the builder create and update actions, task agents, and navigation routes in your account.

  5. Give it your product’s web address, for example app.example.com. It asks once. If your account has several agents, it also asks which one.

  6. Sign in to your product in the test window. The builder opens your product in a separate Chrome window on your computer and puts the agent on the page. Everything in that window is local to your machine until you publish.

If the use cases weren’t saved at sign-up, the screen says Use cases will be found when you start building, and the builder discovers them itself.

Already signed up, or building on a second computer? Open foldspace.ai/start and choose Open in Claude, Open in Codex, or Open in Cursor. It opens your coding tool with the same prompt, and the build continues from step 3 above. To paste the prompt yourself, use it as written:

Read https://foldspace.ai/agents.md and follow it to set up my Foldspace agent. Then keep going with the project's own instructions (its CLAUDE.md or AGENTS.md) and help me build a new experience for my product agent. I already have a Foldspace account, and my agent already exists.

Each coding tool handles a newly added server differently:

Claude installs the Foldspace tools, opens sign-in in your browser, and waits for you. When the project is in a different folder, it asks to move the session there: click Trust workspace, then tell it to continue.

The start prompt connects the tools for you. To connect them ahead of time, install the plugin in Claude Code:

Terminal window
claude plugin marketplace add https://github.com/foldspace-ai/plugins
Terminal window
claude plugin install foldspace-agent-builder@foldspace-plugins

Then run /mcp, pick foldspace, and finish sign-in in the browser. The plugin needs git on your machine. It is a Claude Code plugin only; Codex and Cursor connect the MCP servers directly, and the build rules reach every tool through the project either way.

Without the plugin, add the servers to your coding tool:

Terminal window
claude mcp add --scope user --transport http foldspace https://api.foldspace.ai/mcp
Terminal window
claude mcp add --scope user --transport http foldspace-docs https://docs.foldspace.ai/mcp

For VS Code, Windsurf, and Antigravity, see Vibe coding.

The first session ends at something you can see on your own page, in three levels:

LevelYou see
Agent liveThe agent on your own product page, before it has a single action
Your settingsYour own account, plan, or settings on a card, with real values
Look up recordsA search from your own words, returning rows from your account

How it gets there:

  1. A separate Chrome window opens at your product’s login. Sign in there. The builder notices on its own. This window is a test window with its own browser profile; it keeps your sign-in for next time.
  2. The agent appears on your page. The builder sends you a screenshot and asks you to say hello to it.
  3. It offers three or four experiences to start with, recommended first, from the use cases discovered at sign-up, your product’s own menu, and the conversation starters set up at sign-up. The first ones only read data.
  4. You agree the experience in plain words before it creates anything, for example: “Show my plan and credits needs one new action on your agent and one card to show it in. Sound right?”
  5. It builds and tests it, then hands the test window back to you to try.

While the builder works in the test window, a pill at the foot of the page says Foldspace is building. Leave the window alone until the builder says it’s ready.

An action has two halves. The action lives in Agent Studio and tells the agent when to use it. The code behind it lives in your project, in agent/actions/<action_key>.ts, and does the work. The builder writes both.

For each action, the builder:

  1. Finds the call your app makes. It watches your app in the test window, read-only, and captures a real response for the data the action needs. It never guesses an endpoint or a field name.

  2. Creates the action as a draft in Agent Studio, with every parameter typed, marked required or not, and described by where its value comes from. That description is how the agent chains actions: a required accountId described as coming from find_account makes the agent call find_account first.

  3. Writes the code behind it from the draft’s schema, and registers it in agent/actions/index.ts. The key must equal the action’s key in Agent Studio; a mismatch doesn’t error, the action never fires.

  4. Loads it into the test window and checks that the agent registered it.

  5. Asks you before publishing the action. Once published, it asks the agent the question itself and checks that the reply, and the card, show real data from your account.

The code behind an action returns data and nothing else:

agent/actions/find_project.ts
import { apiFetch, rankBy } from "../utils";
type Project = { id: string; name: string };
export const find_project = {
execute: async (params: { query?: string }) => {
const query = typeof params?.query === "string" ? params.query.trim() : "";
const result = await apiFetch<{ items?: Project[] }>("/YOUR-API-PATH");
if (!result.ok) {
return { success: false, error: result.error, reason: result.reason };
}
const matches = rankBy(result.data.items ?? [], query, {
searchKeys: ["name"],
idOf: (project) => project.id,
});
return { success: true, query, matches };
},
};

A few rules the builder holds every action to:

  • It returns facts, never instructions. “Try again” or “ask the user for the full name” in a response can make the model act on its own. What the agent does next belongs in the action’s instructions in Agent Studio.
  • No results is a result. A search that finds nothing returns success: true with zero matches, not an error.
  • A failed or signed-out call is never drawn as zeros. Every failure carries a reason (signed_out, forbidden, not_found, rate_limited, timeout, unreachable, config, server), and the card shows that state.

For the handler API in depth, see Connect actions and Execute actions.

A task agent handles one reasoning job that code can’t: extracting, summarizing, classifying, or normalizing. It isn’t for API calls, creating or updating records, routing, or parsing a response whose shape you already know; those stay in code.

The builder creates the task agent in Agent Studio, asks you before publishing it, and calls it from the code behind an action with getAgent().runTask({ taskKey, data }). A task agent must be published before code can call it. data carries facts; the instructions live on the task agent, never in the call.

A typical pairing: the action gathers a meeting’s facts from your API in code, then a task agent writes the summary from them. Ask for it in your own words, for example “Prepare me for my next meeting with a customer.”

For the Agent Studio side (instructions, output schema, model, logs), see Task Agents. For runTask() options, see Task Agent API.

Navigation lets the agent take the user to the right screen. A route is a URL template plus a description of what the page is for, in the words a user would use. There is no code behind it.

  • The description decides whether the route is ever offered. “Where a team keeps the work for one project, to find or share its designs” retrieves; “all files inside one project” does not.
  • Every route with a parameter needs a lookup action. /projects/{projectId} works only if an action can turn a project’s name into its id. The builder builds the two together, or neither.
  • Navigation has two switches, and both must be on: each route’s own active switch, and one switch for the agent’s navigation as a whole, which is off on a new subscription.

A new route reaches your users as soon as both switches are on, so the builder asks before turning them on.

An experience is what a user asks for and what they get back: one or more actions, and usually a card drawn in the chat. Name it by its outcome (“show my plan and credits”, “find a customer by name”), and the builder picks the pieces.

Cards come in two kinds:

CardWhat it doesThe agent
View cardShows something: an account, a list, records that need attentionAnswers follow-up questions from exactly what the card shows
Input cardAsks the user to pick one, upload, create, or approveWaits until the user answers or closes it

Anything that writes to your product goes behind an input card the user approves. The builder samples your app’s colors, font, and corner radius so cards match your brand inside the agent’s panel.

The project ships working examples, each taken from production builds, that the builder copies from:

Ask forExample the builder starts from
Show one account a user nameslookup-then-view
Turn a name into the id the next action needsfind-by-name
The user’s records on one cardrecords-list
Records that need attention, with reasonsopportunities-at-risk
Create a record from what the user said, approved on a cardcreate-a-record
Gather facts, then have a task agent write a summaryprepare-for-a-meeting
Starters in the Bottom Bar that change per screenbottom-bar
Tell Foldspace who the signed-in user iswho-is-the-user

After you’ve tried the first experience, the builder offers the next steps as one choice: replacing your conversation starters with ones the agent can answer (at most three, with your yes), starters per page, identifying your users so conversations and analytics stop being anonymous, a second experience, and a short video of the agent to share.

While you build, the experience runs only in the test window on your computer. The actions and task agents the builder creates are in your Foldspace account, but your users don’t see them yet: the agent offers an action only when the code behind it has loaded in the user’s browser.

When you’ve tried the experience and you’re happy with it, ask the builder to publish it (“publish this”, “push it live”). It publishes the actions, task agents, and code behind them and deploys them for you.

  • It asks before anything reaches your users. Publishing an action, task agent, or navigation route, and deploying the code, each wait for your yes.
  • Live things are never edited to test. Publishing an edit to something already live changes the live agent at once. To change a live action, the builder builds a copy beside it, named with _gen2, and switches over when the copy works.
  • Several builders can share one agent. Before each publish, the builder pulls what others have saved for the same agent, so nobody’s work is overwritten.
  • Edit your product’s source code or your website. It works only in its own project folder.
  • Write anything while it browses your app. It reads only, and asks before clicking a button that could do something.
  • Publish, replace your conversation starters, or add hosts without your yes.
  • Create accounts or API keys, in Foldspace or in your product.
  • Store or send your sign-in token anywhere but your product’s own backend. The build refuses tokens, keys, and cookie values in the project.
  • Send your users out of your product. Links go through navigation, in the same tab.

Where are the use cases from sign-up? In Agent Studio, under your agent’s use cases, and on the “You’re all set.” screen behind the use cases found link. The builder reads the same list, so you can name one in your coding tool: “Build the account overview use case.”

The Foldspace tools aren’t available in this chat. The server was added after the chat started. Open a new chat in the project folder and repeat your request.

It’s signed in to the wrong account. In Claude Code, run /mcp, pick foldspace, and sign in as the right account. In Codex, run codex mcp logout foldspace, then codex mcp login foldspace. The builder names the agent it’s working on before it creates anything, so you can stop it there.

Your account has no agent. Create one at app.foldspace.ai, then tell the builder you’re done.

The agent shows on one part of your product but not another. Products that live on several hosts (app., reports., admin.) need each one added. The builder finds the other hosts and asks before adding them.

Your test conversations appear in Foldspace. That’s expected on a new agent: seeing them recorded is part of the first session. On an agent that already has real users, the builder runs in test mode to keep its conversations out of your data.

You’re picking up on another computer, or a colleague started the agent. The builder checks what Foldspace already holds for your agent and starts from the saved code when there is any.