TotalBase
AI Agents

Recipes

What you ask an agent, and what you get: a table, permissions, a DataView, a dashboard, a workflow and the App menu - with the MCP calls behind each.

Everything you build by hand in TotalBase, an agent can build for you through the MCP server. These recipes build part of Acme's field service application, one request at a time: a table, who may see it, a screen, a dashboard, an automation and the menu. Each shows what you ask, and what you get.

Acme's application built from nothing through the MCP server: each tool call on the left, as an agent makes them, the admin filling up on the right, ending in the App.

Result shows what the agent built, as people see it. Calls shows the MCP calls it made, with their real arguments: you don't write them, the agent does, but they show exactly what happened and what the agent can and can't do.

Ask in your own words and your own language. The agent reads TotalBase's guides on connecting, looks at what exists first (describe_table, list_roles, list_dataviews), and chooses the calls itself. These recipes assume an agent connected with an administrator's token: see Quickstart with AI.

A table with its rules

"Create a work_orders table: a number assigned automatically, a site, the branch that handles it, a priority (low, normal, high, urgent), a status (new, assigned, in progress, completed, cancelled), the technician, a description and a resolution. A completed order must have a resolution."
Database › work_orders as the agent left it: its columns, the CHECK on the resolution and the status colors.
Database › work_orders as the agent left it: its columns, the CHECK on the resolution and the status colors.

The agent created the table, its keys and constraints in one transaction, exposed it to the API, and labeled and colored its values.

Database › work_orders shows the table, its CHECK constraints and its presentation. The rule about the resolution is PostgreSQL's: it holds for every writer, the agent included. See Tables.

Permissions for a role

"Dispatchers see and assign the work orders of their own branch. Technicians see only the orders assigned to them, and can change the status and write the resolution."
The Work orders kanban signed in as a technician: only the orders assigned to them.
The Work orders kanban signed in as a technician: only the orders assigned to them.

The agent granted each role its actions, its row filter and its fields. A technician signing in sees only their own orders.

Roles › Technician › Permissions shows the grants. To see them from the role's side, ask the agent to read as that role: query_records answers with what the role may see. See Row filters.

A DataView

"Make a kanban of work orders by status for dispatchers, titled by the order number, and put it in the App."
The Work orders kanban in the App: a lane per status, each card titled by its number.
The Work orders kanban in the App: a lane per status, each card titled by its number.

The agent created the kanban over work_orders and published it to Dispatchers and Managers. It's in their App menu.

DataViews › Work orders; open it in the App, or sign in as a dispatcher. See Kanban.

A dashboard

"Build an Operations dashboard: open orders as a number, open orders by status as bars. Give it to managers."
The Operations dashboard in the App: open orders as a number and by status as bars.
The Operations dashboard in the App: open orders as a number and by status as bars.

The agent created the dashboard, wrote and tried each widget's query, and published it to Managers.

A dashboard's queries run with its author's authority, not the viewer's permissions. Tell the agent who it's for: "only their branch's orders" makes it filter with $USER.branch in the SQL. See Dashboards.

A workflow

"When a work order is completed, email the dispatch office its resolution."
Settings › Runs of Order completed: the test run, step by step.
Settings › Runs of Order completed: the test run, step by step.
The email the dispatch office received.
The email the dispatch office received.

The agent created the workflow, tried it on a real order with a test run, then published and enabled it.

Workflows › Order completed › Settings › Runs shows the test run, step by step. See Workflows.

The App menu

"Group the App menu: Operations with the kanban and the dashboard, Fleet with the fleet map."
The App as a dispatcher: Operations and Fleet groups, with only what they may open.
The App as a dispatcher: Operations and Fleet groups, with only what they may open.

The agent arranged the menu in groups. Each user sees only the entries they may open.

the App, as a dispatcher and as a manager: each sees only the entries they may open. See The App.

What the agent can't do

  • Anything its token's user can't. Permissions, guardrails and PostgreSQL's constraints apply to every call.
  • Raw SQL, unless you turn on SQL token access: views, functions and triggers need it. See Tokens.
  • Change its own limits. MCP settings are changed only by an administrator signed in to the admin.
  • Delete without asking, in Full mode: destructive calls need confirm, which the agent is told to ask you for. See MCP Server.

Next steps