MCP tools

The Appbricx MCP server gives your agent 55 tools: write the code, try the app as each user, ship it and run it. Each calls the same operation as the matching developer-API route, with the same scopes and answers.

55 toolsReference homeGuide: the MCP server

On this page
  1. Connect
  2. Find your way
  3. whoami
  4. get_guide
  5. search_docs
  6. script_api
  7. Projects
  8. list_projects
  9. create_project
  10. get_project
  11. update_project
  12. duplicate_project
  13. collaborators
  14. delete_project
  15. Write the code
  16. code
  17. project_files
  18. packages
  19. assets
  20. check_contract
  21. apply_contract
  22. get_contract
  23. check_code
  24. check_component
  25. Start from a template
  26. search_templates
  27. get_template
  28. use_template
  29. save_template
  30. Try it as your users
  31. call_app
  32. screenshot
  33. workflows
  34. run
  35. message_previews
  36. roles
  37. explain
  38. verify
  39. job
  40. Data and files
  41. query_data
  42. sql_query
  43. sql
  44. edit_rows
  45. describe_schema
  46. data_transfer
  47. snapshots
  48. migrations
  49. storage
  50. Ship and roll back
  51. deploy
  52. deploys
  53. versions
  54. routing
  55. domains
  56. Operate
  57. logs
  58. tail
  59. stats
  60. app_users
  61. sign_in_providers
  62. secrets
  63. integrations
  64. Many steps in one call
  65. run_script

Connect

Streamable HTTP at https://appbricx.com/api/mcp (self-hosted: your platform host plus /mcp). The client signs in through the browser (OAuth) on first connect, or sends a personal access token as a bearer. Add ?project=<id> (or the x-appbricx-project header) to pin a project: project_id becomes optional and table, workflow and role arguments become enums of the project's current names.

.mcp.json
{
  "mcpServers": {
    "appbricx": {
      "type": "http",
      "url": "https://appbricx.com/api/mcp?project=<project-id>"
    }
  }
}

deploy, verify, use_template, snapshot restores and rollbacks take minutes. After a wait they answer { status: "running", job_id }; calling the same tool again joins the same run instead of starting a second one, and job reads it from anywhere. A client that sends a progress token gets progress notifications. For many steps, run_script calls the tools from one TypeScript script.

Resource appbricx://docs/guide: The whole guide get_guide serves, as one markdown resource.

Find your way

Who you are, the guide and the docs.

whoamiread-only

Who am I. The signed-in user, the token's scopes and its workspace(s).

Scope
any token
Output
The signed-in user, how the call authenticated, the token's scopes and its workspaces.

Input schema

No arguments.

Tool call
{
  "name": "whoami",
  "arguments": {}
}
Result (text content)
{
  "user": {
    "id": "96f4a291-…",
    "email": "dev@example.com"
  },
  "auth": "oauth",
  "scopes": [
    "read",
    "apply",
    "deploy"
  ],
  "workspaces": [
    {
      "id": "6c4ea024-…",
      "name": "Acme",
      "role": "owner"
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:51

get_guideread-only

Guide. The authors' guide (markdown). No arguments: the quickstart and an index of sections with sizes; read a section only when you use it. section: that section (a long one comes in parts of about 36 KB: part N). topic: just where one export, component or heading is defined, e.g. {section: "kit", topic: "DataTable"} (a few hundred bytes).

Scope
any token
Output
Markdown. No arguments: a short quickstart (one complete small app and the loop) and an index of every section with its size; read a section only when you use it. section: that section (a long one, like the kit reference, comes in parts of about 36 KB: part: N). topic: only where one export, component, SQL function, table or heading is defined, a few hundred bytes.

Input schema

NameTypeDescription
sectionoptional"operate" | "codefirst" | "debug" | "code" | "data" | "lifecycle" | "scripts" | "ctx" | "sdk" | "errors"
partoptionalnumberA long section's part (default 1) (≥ 1)
topicoptionalstringOne export, component, SQL function, table or heading, e.g. "DataTable": just its definition. With section, in it; else everywhere. Not with part (min 1, max 100)
Tool call
{
  "name": "get_guide",
  "arguments": {
    "section": "kit",
    "topic": "DataTable"
  }
}
Result (text content)
## Quickstart: build an app on appbricx

An app is code-first: Postgres SQL in `db/` plus a TypeScript/React project. …

Source: internal/svc/agentapi/transport/tools.json:65

search_docsread-only

Search the docs. Search every get_guide section and tool description by words. Answers ranked matches with their lines and the get_guide call that opens each. One name ("DataTable") also answers where it is defined (exact).

Scope
any token (no project)
Output
Guide sections and tool descriptions ranked by your words, with the matching lines and the get_guide call that opens each section. A query of one name ("DataTable", "useQuery") also answers where it is defined, exactly.

Input schema

NameTypeDescription
queryrequiredstringA few words, e.g. "webhook signature", "row level security", "send email from a workflow" (min 1, max 300)
limitoptionalnumberHow many sections (default 6, at most 20) (≥ 1, ≤ 20)
Tool call
{
  "name": "search_docs",
  "arguments": {
    "query": "soft delete",
    "limit": 5
  }
}
Result (text content)
{
  "query": "soft delete",
  "results": [
    {
      "kind": "section",
      "id": "codefirst",
      "title": "Code-first: TypeScript and SQL files",
      "lines": [
        "select ctx.soft_delete('t');  triggers and functions"
      ],
      "open": {
        "tool": "get_guide",
        "section": "codefirst"
      }
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:4609

script_apiread-only

Script API. The .d.ts of run_script's tools object: every tool typed from its schemas, with its description as JSDoc. tools narrows it. Read it once before writing scripts.

Scope
any token
Output
The TypeScript declarations of run_script's tools object (one async function per tool, typed from its schemas). The text is the .d.ts; structuredContent is { declarations, tools }.

Input schema

NameTypeDescription
toolsoptionalArray<string>Only these tools' declarations (default: every tool) (at most 100 items)
Tool call
{
  "name": "script_api",
  "arguments": {
    "tools": [
      "code",
      "call_app",
      "verify"
    ]
  }
}
Result (text content)
declare const tools: {
  /** Read and change a code-first project by what each file is … */
  code(input: { project_id?: string; action?: "list" | "read" | … }): Promise<any>;
  …
};

Source: internal/svc/agentapi/transport/tools.json:4052

Projects

Create, rename, copy, share and delete projects.

list_projectsread-only

List projects. Projects this token can reach (newest first).

Scope
any token
Output
Projects the token can reach, newest first.

Input schema

No arguments.

Tool call
{
  "name": "list_projects",
  "arguments": {}
}
Result (text content)
{
  "projects": [
    {
      "id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
      "name": "Teamday",
      "slug": "teamday",
      "workspace_id": "6c4ea024-…",
      "updated_at": "2026-10-28T09:51:48.572Z"
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:108

create_projectwrites

Create project. Create an empty project in the token's workspace. Then build it with use_template (the code-first starter or a search_templates app), or write its files with code or project_files and apply them to dev. Needs apply.

Scope
apply
Output
The new, empty project. Build it next with use_template or by writing files.
Errors
FORBIDDEN_SCOPE without apply.

Input schema

NameTypeDescription
descriptionoptionalstring (max 2000)
namerequiredstring (min 1, max 100)
idoptionalstringKeep this project id (import an existing project, e.g. from another appbricx server) (uuid)
Tool call
{
  "name": "create_project",
  "arguments": {
    "name": "Teamday",
    "description": "Team experiences, booked in a minute"
  }
}
Result (text content)
{
  "project": {
    "id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "name": "Teamday",
    "slug": "teamday",
    "workspaceId": "6c4ea024-…"
  }
}

Source: internal/svc/agentapi/transport/tools.json:122

get_projectread-only

Project state. Whether the project is built, the last build failure, its preview path, and platform_updates {dev, prod}: whether each env was built with an older platform than this server ships (next says to re-apply dev and deploy).

Scope
any token
Output
Whether the project is built, the last failed apply (state.failed: when, which stage, the message, the version that stayed live), its preview path, and platform_updates {dev, prod}: whether each env was built with an older platform than this server ships (behind, built_with, current, the fixes it lacks); next then says to re-apply dev and deploy.

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
Tool call
{
  "name": "get_project",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b"
  }
}
Result (text content)
{
  "project": {
    "id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "name": "Teamday",
    "role": "owner"
  },
  "state": {
    "built": true,
    "failed": null
  },
  "previewPath": "/preview/3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b/"
}

Source: internal/svc/agentapi/transport/tools.json:158

update_projectwrites

Update a project. Rename a project, change its description, or archive / unarchive it (archived projects keep running). Needs apply (archiving: a workspace owner or admin). URLs don't change with the name.

Scope
apply (archiving: a workspace owner or admin)
Output
The project as it is now. Renaming doesn't move the dev or production address (routing does).

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
nameoptionalstringThe new name (1 to 100 characters) (min 1, max 100)
descriptionoptionalstringThe new description (at most 500 characters; "" clears it) (max 500)
archivedoptionalbooleantrue archives the project, false unarchives it (owner or admin)
Tool call
{
  "name": "update_project",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "name": "Teamday Pro"
  }
}
Result (text content)
{
  "project": {
    "id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "name": "Teamday Pro",
    "slug": "teamday",
    "description": "…",
    "status": "active"
  }
}

Source: internal/svc/agentapi/transport/tools.json:4094

duplicate_projectwrites

Duplicate a project. Copy a project into its workspace as "<name> (Copy)"; its dev app is applied in the background (get_project shows built). with_data copies the dev database too. Production, domains and collaborators aren't copied. Needs apply.

Scope
apply
Output
The copy, "<name> (Copy)" in the same workspace. Its dev app is applied in the background (get_project shows built: true when done); with_data also copies the dev database. Production, domains and collaborators are not copied.

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
with_dataoptionalbooleanAlso copy the dev database's rows (default: only the app)
Tool call
{
  "name": "duplicate_project",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "with_data": true
  }
}
Result (text content)
{
  "project": {
    "id": "7f2c…",
    "name": "Teamday (Copy)",
    "slug": "teamday-copy",
    "workspaceId": "6c4ea024-…"
  },
  "note": "The dev app is being applied …"
}

Source: internal/svc/agentapi/transport/tools.json:5011

collaboratorswrites

Project collaborators. People a project is shared with outside its workspace. list (default); add {email, role: admin | editor | viewer} (only owners and admins share as admin or invite someone new); remove {user_id}. Writes need apply.

Scope
read to list; apply to add or remove
Output
The people the project is shared with outside its workspace.
Errors
Only owners and admins share as admin or invite an address with no account.

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
actionoptional"list" | "add" | "remove"list (default), add or remove
emailoptionalstringadd: who to share with (max 320)
roleoptional"admin" | "editor" | "viewer"add: their role on this project
user_idoptionalstringremove: the collaborator's user id (from list)
Tool call
{
  "name": "collaborators",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "add",
    "email": "client@example.com",
    "role": "viewer"
  }
}
Result (text content)
{
  "action": "add",
  "collaborator": {
    "user_id": "a81e…",
    "email": "client@example.com",
    "role": "viewer"
  }
}

Source: internal/svc/agentapi/transport/tools.json:5075

delete_projectwrites

Delete a project. Delete a project: its site and custom domains stop answering, then it leaves every list. Databases, releases and snapshots are kept for an operator; nothing here restores it. Without confirm (the exact name or id) the answer is 428 CONFIRM_REQUIRED with a preview. Workspace owners and admins; needs deploy.

Scope
deploy (a workspace owner or admin)
Output
Without confirm, 428 CONFIRM_REQUIRED with a preview of what goes dark. With confirm set to the project's exact name (or id): the site and its custom domains stop answering, then the project leaves every list.
Errors
CONFIRM_REQUIRED (428) until confirm matches.

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
confirmoptionalstringThe project's exact name (or id), repeated to confirm the delete (max 200)
Tool call
{
  "name": "delete_project",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "confirm": "Teamday"
  }
}
Result (text content)
{
  "deleted": true,
  "project": {
    "id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "name": "Teamday"
  },
  "site_hosts_down": [
    "teamday.apps.appbricx.com"
  ]
}

Source: internal/svc/agentapi/transport/tools.json:4179

Write the code

The dev draft: routes, components, actions, workflows, SQL, templates, packages and images.

codewrites

Code-first project parts. Read and change a code-first project by part, on the dev draft. kind: route (name is its URL, e.g. "/bookings/:id", or "_layout"), component, lib, style, action, workflow, table, access, query, seed, sql, email, sms, notify, prompt, icon, config or file (a path). list (default), read, create (no content: a scaffold for the project), update (whole file), edit {edits: [{old, new}]} (prefer for small changes), rename, delete. Writes take rev and then: "check" | "apply"; past about 45 s: saved, with a job_id (never repeat the write). Reads need read; writes apply. Details: get_guide {section: "tools", topic: "code"}.

Scope
read for list and read; apply for writes
Output
list: every part of the draft grouped by kind, with what it declares (route URLs, action names, workflows and their triggers, tables, policies). Writes answer the new rev and, with then, the check report (diagnostics with file and line) or the apply result (detail: true lists every schema statement run). Past about 45 s the write answers as saved with a job_id: read it with job, never repeat the write.
Errors
ALREADY_EXISTS (409) on create; EDIT_NOT_APPLIED (400) when an old text isn't found exactly once; DRAFT_CHANGED (409) on a stale rev.

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
actionoptional"list" | "read" | "create" | "update" | "edit" | "rename" | "delete"list (default), read, create, update, edit, rename or delete
kindoptional"access" | "action" | "component" | "config" | "email" | "file" | "icon" | "lib" | "notify" | "prompt" | "query" | "route" | "seed" | "sms" | "sql" | "style" | "table" | "workflow"What the part is (see the description); optional for list
nameoptionalstringA route's URL or file stem, a component, table or template name, or a path (kind file) (max 300)
contentoptionalstringcreate / update: the file's full text (max 1048576)
editsoptionalArray<{ old: string; new: string; replace_all?: boolean }>edit: exact replacements applied in order (at least 1 items, at most 50 items)
tooptionalstringrename: the new name (max 300)
revoptionalnumberThe draft revision the write is based on (default: the current one); a stale rev is DRAFT_CHANGED (≥ 0)
thenoptional"check" | "apply"After a write: check the draft or apply it to dev (past about 45 s: a job_id; the write is saved)
allow_destructiveoptionalbooleanthen apply: also run the schema plan's drops (dev is snapshotted first)
detailoptionalbooleanthen "apply": list every schema statement run
Tool call
{
  "name": "code",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "edit",
    "kind": "action",
    "name": "bookings",
    "edits": [
      {
        "old": "roles: [\"ops\"]",
        "new": "roles: [\"ops\", \"host\"]"
      }
    ],
    "then": "check"
  }
}
Result (text content)
{
  "action": "edit",
  "kind": "action",
  "name": "bookings",
  "path": "server/bookings.ts",
  "rev": 14,
  "dirty": true,
  "check": {
    "ok": true,
    "report": {
      "errors": [],
      "warnings": []
    },
    "diagnostics": []
  }
}

Source: internal/svc/agentapi/transport/tools.json:4244

project_fileswrites

Project files. The project's source tree on the dev draft (nothing is live until apply; get_guide section "codefirst"). list, read {path | paths}, write {path, content | files}, delete, move {path, to}, reset, check (file:line), apply (the draft becomes the next dev version; slow: job_id), diff. upload_url: with a shell, push the whole folder as one tar.gz (curl) instead. Writes pass rev (DRAFT_CHANGED). Reads need read; the rest apply. Details: get_guide {section: "tools", topic: "project_files"}.

Scope
read for list, read, check and diff; apply for the rest
Output
The dev draft as paths: list, read (one path or several), write (one or many files), delete, move, reset (drop the draft), check (the report at file:line), apply (the draft becomes the next dev version; a slow one answers a job_id; detail: true lists every schema statement run), diff (per-file unified diffs), upload_url (a token and the curl command to push a whole folder as one tar.gz from a shell).
Errors
DRAFT_CHANGED (409), DRAFT_EMPTY, FILE_NOT_FOUND (404).

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
actionoptional"list" | "read" | "write" | "delete" | "move" | "reset" | "check" | "apply" | "diff" | "upload_url"list (default), read, write, delete, move, reset, check, apply, diff or upload_url
pathoptionalstringA file's path, e.g. functions/pass.ts (max 200)
pathsoptionalArray<string>read: several files
contentoptionalstringwrite: the file's new text
filesoptionalobjectwrite: several files at once, path → text
tooptionalstringmove: the new path (max 200)
revoptionalnumberThe draft revision the edit is based on (from the last answer); a newer draft refuses it (≥ 0)
versionoptionalnumberlist/read: a dev version's files instead of the draft; diff: compare to this version instead of the draft (≥ 0)
fromoptionalnumberdiff: the version to compare from (default: the draft's base version) (≥ 0)
allow_destructiveoptionalbooleanapply: also run the plan's drops after a snapshot
detailoptionalbooleanapply: list every schema statement run
Tool call
{
  "name": "project_files",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "write",
    "files": {
      "db/schema/booking.sql": "create table if not exists booking (…);"
    }
  }
}
Result (text content)
{
  "action": "apply",
  "rev": 15,
  "version": 9,
  "report": {
    "ok": true,
    "errors": [],
    "warnings": []
  },
  "summary": {
    "demo_logins": [
      {
        "role": "ops",
        "email": "ops@demo.teamday.app"
      }
    ]
  }
}

Source: internal/svc/agentapi/transport/tools.json:2200

packageswrites

npm packages. A code-first project's npm packages, on the dev draft. list (default): dependencies with locked versions and what the platform provides (react: never add). add {packages: ["recharts", "date-fns@^4"]}: resolves on the server and writes package.json and the lockfile; remove {packages}. then: "check" | "apply" (slow: job_id). Reads need read; writes apply.

Scope
read to list; apply to add or remove
Output
package.json's dependencies with the versions package-lock.json pins and what the platform provides (react, react-dom, @appbricx/*). add and remove resolve the whole tree on the server (versions at least 7 days old, registry tarballs with integrity) and write both files in one draft edit.
Errors
400 for a provided package or a git, file or URL source; PACKAGE_NOT_FOUND; PACKAGE_RESOLVE_FAILED.

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
actionoptional"list" | "add" | "remove"list (default), add or remove
packagesoptionalArray<string>add: "name" or "name@range"; remove: names (at most 50 items)
revoptionalnumberThe draft revision the edit is based on (default: the current one) (≥ 0)
thenoptional"check" | "apply"After add or remove: check or apply (past about 45 s: a job_id; the edit is saved)
Tool call
{
  "name": "packages",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "add",
    "packages": [
      "recharts",
      "date-fns@^4"
    ],
    "then": "check"
  }
}
Result (text content)
{
  "action": "add",
  "dependencies": [
    {
      "name": "recharts",
      "range": "^3.1.2",
      "locked": "3.1.2"
    }
  ],
  "packages_locked": 38,
  "rev": 16
}

Source: internal/svc/agentapi/transport/tools.json:4878

assetswrites

Project assets. Files at /assets/<name>: images, fonts, video, audio, PDFs, text. Images, fonts, txt/csv/json/vtt ≤ 10 MB; mp4/webm ≤ 100 MB; mp3/m4a/ogg/wav, PDF ≤ 25 MB (.mov: convert to mp4). list (default); upload {name, base64 | text, content_type?} (≤ ~3 MB a request; replaces a name; SVGs with scripts refused); delete {name}. Writes need apply. Bigger files (clips), URLs, folders, renames: storage. Details: get_guide {section: "tools", topic: "assets"}.

Scope
read to list; apply to upload or delete
Output
The app's own files served at /assets/<name> to every visitor: images, logos, icons and fonts (at most 10 MB each), mp4 and webm video (100 MB), mp3, m4a, ogg and wav audio and PDFs (25 MB), and txt, csv, json and vtt captions (10 MB). Video, audio and PDFs are served in byte ranges, so a <video> seeks and Safari plays it; a PDF opens inline. A .mov is refused with the ffmpeg command that makes an MP4. An upload replaces a file of the same name; base64 carries files up to about 3 MB (an MCP request is at most 4 MiB). For bigger files (a clip), folders, uploads from a URL, moves and renames, use storage.
Errors
BAD_ASSET (an SVG with scripts or event handlers, an unknown type), ASSET_NOT_FOUND.

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
actionoptional"list" | "upload" | "delete"list (default), upload or delete
nameoptionalstringupload / delete: the file name, e.g. hero.png (max 128)
base64optionalstringupload: the file's bytes as base64 (or a data: URL) (max 14000000)
textoptionalstringupload: text (an SVG, captions, CSV) (max 1048576)
content_typeoptionalstringupload: the MIME type (default: from the extension) (max 100)
Tool call
{
  "name": "assets",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "upload",
    "name": "logo.svg",
    "text": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">…</svg>"
  }
}
Result (text content)
{
  "action": "upload",
  "asset": {
    "name": "logo.svg",
    "path": "/assets/logo.svg",
    "bytes": 1834,
    "content_type": "image/svg+xml"
  },
  "use": "<img src=\"/assets/logo.svg\"> …"
}

Source: internal/svc/agentapi/transport/tools.json:5395

check_contractread-only

Check the project. Check a whole code-first tree you send (files), saving nothing: errors (must be empty to apply), fixes and warnings at file:line; plan: true adds env's migration plan and drift. The project's own draft is checked with project_files {action: "check"} or a write's then: "check". The tool keeps its old name. Details: get_guide {section: "tools", topic: "check_contract"}.

Scope
any token
Output
The check report of a whole code-first tree you send (files), saving nothing: errors (must be empty to apply), fixes and warnings, located file:line, from the SQL lint, the strict TypeScript check and the platform's lint rules. plan: true adds env's database plan: the expand steps an apply would run, the contract steps (drops) left pending, and drift. The project's own draft is checked with project_files {action: "check"} or a write's then: "check".

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
planoptionalbooleanAlso answer the schema plan (a migration dry run on env's database)
envoptional"dev" | "prod"The database the plan is for: "dev" (default) or "prod"
filesrequiredobjectThe code-first tree, path → text: app.config.ts, db/**/*.sql, routes/, components/, server/, workflows/ … (get_guide section "codefirst")
Tool call
{
  "name": "check_contract",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "files": {
      "app.config.ts": "…",
      "db/schema/booking.sql": "…",
      "routes/bookings.tsx": "…"
    },
    "plan": true
  }
}
Result (text content)
{
  "report": {
    "ok": false,
    "errors": [
      "routes/bookings.tsx:14: Property 'titel' does not exist on type 'BookingRow'. Did you mean 'title'?"
    ],
    "warnings": []
  },
  "plan": {
    "env": "dev",
    "mode": "sql",
    "expand": [
      {
        "sql": "alter table booking add column notes text"
      }
    ],
    "contract": [],
    "drift": []
  }
}

Source: internal/svc/agentapi/transport/tools.json:232

apply_contractwrites

Apply files to dev. Build dev from a whole code-first tree you send (files): migrates with the plan's expand steps (rows kept), builds, arms workflows; answers the check report and a build summary (demo sign-ins, warnings); 422 = it doesn't check; slow: status "running" with a job_id. The project's own draft applies with project_files {action: "apply"} or a write's then: "apply". Needs apply. The tool keeps its old name. Details: get_guide {section: "tools", topic: "apply_contract"}.

Scope
apply
Output
Builds dev from a whole code-first tree you send (files): the database evolves with the plan's expand steps (rows kept), seeds run, routes and components are type-checked and bundled, workflows are armed. Answers the check report, a build summary with a demo sign-in per role, and warnings; schema statements come back as a count with the first few and any destructive one (detail: true lists all). A slow apply answers status running with a job_id. The project's own draft applies with project_files {action: "apply"} or a write's then: "apply".
Errors
CONTRACT_INVALID (422) with report; PROJECT_BUSY (409) while another apply runs; JSON_RETIRED for a JSON contract (convert it with appbricx migrate --to code).

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
filesrequiredobjectThe code-first tree, path → text: app.config.ts, db/**/*.sql, routes/, components/, server/, workflows/ … (get_guide section "codefirst")
allow_destructiveoptionalbooleanAlso run the plan's drops after a snapshot (rows in them are lost; dev only)
detailoptionalbooleanList every schema statement run (default: count, first few, any destructive)
Tool call
{
  "name": "apply_contract",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "files": {
      "app.config.ts": "…",
      "db/schema/booking.sql": "…",
      "routes/bookings.tsx": "…"
    }
  }
}
Result (text content)
{
  "report": {
    "ok": true,
    "errors": []
  },
  "appUrl": "https://dev-teamday.apps.appbricx.com",
  "summary": {
    "tables": 5,
    "routes": 3,
    "actions": 2,
    "workflows": 2,
    "demo_logins": [
      {
        "role": "hr",
        "email": "hr@demo.teamday.app"
      }
    ]
  },
  "warnings": [
    "migrate: pending contract step, not run (drop column): alter table booking drop column legacy_ref"
  ]
}

Source: internal/svc/agentapi/transport/tools.json:271

get_contractread-only

Get the app. What the applied code-first app declares, read from app.config.ts and the code: app, auth, personas (roles), workflows, realtime, app_url and each inbound webhook's URL (on the env's app host, path parameters as /:key) and secret; null before the first apply. format "files": the files instead; env "prod": what is live; version: an earlier dev version; section: one key. The tool keeps its old name: there is no JSON contract. Details: get_guide {section: "tools", topic: "get_contract"}.

Scope
any token
Output
The project's settings document and, with format: "files", the whole tree; app_url (dev, and prod once deployed) and each inbound webhook's URL with who signs it. env "prod" answers what the live release published; version reads an earlier dev version.

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
envoptional"dev" | "prod""dev" (default) or "prod": what the live deployment published
versionoptionalnumberA dev version (from versions list) (≥ 1)
sectionoptional"app" | "auth" | "personas" | "workflows" | "realtime"One top-level key: app, auth, personas, workflows or realtime
formatoptional"json" | "files""json" (default): the app's settings; "files": the version's files (path → text)
Tool call
{
  "name": "get_contract",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "format": "files"
  }
}
Result (text content)
{
  "format": "files",
  "files": {
    "app.config.ts": "import { defineApp } from \"@appbricx/define\"; …",
    "db/schema/booking.sql": "…"
  },
  "app_url": {
    "dev": "https://dev-teamday.apps.appbricx.com",
    "prod": null
  },
  "webhooks": []
}

Source: internal/svc/agentapi/transport/tools.json:181

check_coderead-only

Check code before applying it. Fast feedback on one piece of code, project unchanged. kind component (static, types, compile, render gates), function or step (compile and strict ctx types; with run {input | row, as, env} and project_id a dry run whose writes come back as effects), rule {entity, on, source, run {row, as}}: the verdict on that row. A failing gate is ok: false with each stage's errors, not a tool error. Needs read. Details: get_guide {section: "tools", topic: "check_code"}.

Scope
read
Output
Fast feedback on one piece of code without changing the project: each stage (static, types, compile, render, run) with pass, fail or skipped and its errors at your own line numbers. A failing gate is ok: false, not a tool error.

Input schema

NameTypeDescription
entityoptionalstringrule: the table the rule guards
kindrequired"component" | "function" | "step" | "rule"
langoptional"js" | "ts" | "python"function, step: "js" (default) or "python"
messageoptionalstringrule: its refusal message (when the check returns false)
nameoptionalstringcomponent: its PascalCase name; rule: its id (max 64)
onoptional"create" | "update"rule: create (default) or update
project_idoptionalstringThe project the code is for: needed for rule and run (types and compile work without it) (uuid)
runoptional{ allow_http?: boolean; as?: string | { role: string; user_id?: string; workspace?: string }; env?: "dev" | "prod"; event?: object; input?: unknown; old?: object; row?: object }Run the code once as a dry run (nothing is written; effects are listed)
sampleoptionalobjectcomponent: the props the render gate renders with
sourceoptionalstringcomponent: the TSX file; function/step: the body; rule: the check body (max 200000)
Tool call
{
  "name": "check_code",
  "arguments": {
    "kind": "component",
    "name": "StatCard",
    "source": "export default function StatCard({ label }: { label?: string }) { return <div>{label}</div>; }",
    "sample": {
      "label": "Bookings"
    }
  }
}
Result (text content)
{
  "ok": true,
  "kind": "component",
  "stages": [
    {
      "name": "static",
      "status": "pass"
    },
    {
      "name": "types",
      "status": "pass"
    },
    {
      "name": "compile",
      "status": "pass"
    },
    {
      "name": "render",
      "status": "pass",
      "ms": 212
    }
  ],
  "html": "<div class=\"rounded-lg border p-4\">…</div>"
}

Source: internal/svc/agentapi/transport/tools.json:3587

check_componentread-only

Check a custom component. Run one component (components/<Name>.tsx) through the gates: import allowlist, strict TypeScript, compile and a sandboxed render with `sample` props and with empty props. One that imports @appbricx/ui, project files or npm packages is type-checked only (warnings say so). `passed` lists only gates that ran. check_code {kind: "component", project_id} resolves project imports. Details: get_guide {section: "tools", topic: "check_component"}.

Scope
any token
Output
One component through the static, types, compile and render gates. passed lists only the gates that ran; a render that couldn't run is a warning, never a pass.

Input schema

NameTypeDescription
namerequiredstringPascalCase component name — the default export must use it
sampleoptionalobjectProps the render gate uses (same as the component's "sample")
sourcerequiredstringThe whole TSX file
Tool call
{
  "name": "check_component",
  "arguments": {
    "name": "StatCard",
    "source": "export default function StatCard({ label }: { label?: string }) { return <div>{label}</div>; }",
    "sample": {
      "label": "Bookings"
    }
  }
}
Result (text content)
{
  "ok": true,
  "passed": [
    "static",
    "types",
    "compile",
    "render"
  ],
  "errors": [],
  "warnings": []
}

Source: internal/svc/agentapi/transport/tools.json:537

Start from a template

Apps to start a project from, and your workspace's own.

search_templatesread-only

Search templates. Search the template marketplace before building a common feature. Kinds: app (a whole code-first app use_template starts a project from), block, workflow, component (format "code": a block use_template adds to your project; "json": written for JSON contracts, read one with get_template as a recipe). Each result has slug, kind, title, summary, params and format ("code" or "json"); your workspace's private templates come back marked private. Nothing found: get_guide section "codefirst".

Scope
any token
Output
Matching templates (slug, kind, title, summary, category, tags, param names), best match first; your workspace's private templates come back too, marked private.

Input schema

NameTypeDescription
categoryoptional"bookings" | "payments" | "teams" | "collaboration" | "notifications" | "reporting" | "commerce" | "health" | "learning" | "finance" | "productivity" | "support" | "ai" | "events" | "hospitality" | "ui" | "sales" | "marketing" | "operations"
kindoptional"app" | "block" | "workflow" | "component"
limitoptionalnumber (≥ 1, ≤ 100)
queryoptionalstringWords describing what you need, e.g. "stripe subscription", "comments with mentions", "booking reminder" (max 200)
scopeoptional"all" | "public" | "workspace"all (default), public (Appbricx only) or workspace (private only)
Tool call
{
  "name": "search_templates",
  "arguments": {
    "query": "bookings",
    "kind": "app",
    "limit": 5
  }
}
Result (text content)
{
  "templates": [
    {
      "slug": "team-outings",
      "kind": "app",
      "title": "Team outings (code-first)",
      "summary": "A code-first starter: companies book team experiences from hosts…",
      "category": "bookings",
      "params": [
        "brand_name",
        "tagline"
      ]
    }
  ],
  "total": 1
}

Source: internal/svc/agentapi/transport/tools.json:312

get_templateread-only

Get a template. One template in full: manifest, README, params, what it adds and, for blocks, workflows and components, the fragment to rewrite as files. include_contract: an app's whole file tree. format says whether it is code-first.

Scope
any token
Output
One template: its README, params, what it adds (tables, roles, routes, workflows) and, with include_contract, its files filled with the defaults.

Input schema

NameTypeDescription
include_contractoptionalbooleanApps only: include the whole app (a code-first app's files, path → text)
slugrequiredstringTemplate slug from search_templates (min 1, max 80)
Tool call
{
  "name": "get_template",
  "arguments": {
    "slug": "team-outings"
  }
}
Result (text content)
{
  "template": {
    "slug": "team-outings",
    "kind": "app",
    "params": [
      {
        "name": "brand_name",
        "default": "Teamday",
        "example": "Offsite Co"
      }
    ],
    "inside": {
      "tables": [
        "experience",
        "slot",
        "booking"
      ],
      "routes": [
        "/",
        "/experiences/:id",
        "/bookings"
      ]
    }
  }
}

Source: internal/svc/agentapi/transport/tools.json:381

use_templatewrites

Use a template. App template: without project_id, a new project (named `name`) built in dev; with project_id, built into that empty project. dry_run: true checks it and changes nothing (read scope): call it first. A code-first block (format "code") adds its files to the project's dev draft and applies it (needs project_id; a file or table the project has is refused). JSON blocks, workflows and components answer 410 TEMPLATE_RETIRED: read them with get_template and write the files. A slow build answers status "running": call again. DEV only. Needs apply.

Scope
apply (a dry run needs read)
Output
An app template creates a project (or fills an empty one) and builds it in dev, code-first. dry_run: true answers the check report and what it adds, changing nothing. Block, workflow and component templates merged into JSON contracts and are refused (TEMPLATE_RETIRED): write the files they describe instead.
Errors
PROJECT_HAS_APP (409), TEMPLATE_PARAMS (422) for a param outside its pattern, TEMPLATE_RETIRED (410) for a block, workflow or component.

Input schema

NameTypeDescription
dry_runoptionalboolean
nameoptionalstringApp templates: the new project's (and app's) name (min 1, max 100)
paramsoptionalobjectWhere the template attaches, as get_template lists (e.g. { "attach_to": "task" })
prefixoptionalstringAdd the template's tables, workflows, pages and components under this prefix (e.g. "crm") when names clash
project_idoptionalstringThe project to add a block, workflow or component to (omit for an app template to create a new project) (uuid)
slugrequiredstring (min 1, max 80)
workspace_idoptionalstringCreating a project with a session: the workspace (uuid)
Tool call
{
  "name": "use_template",
  "arguments": {
    "slug": "team-outings",
    "name": "Offsite Co",
    "params": {
      "brand_name": "Offsite Co"
    }
  }
}
Result (text content)
{
  "applied": true,
  "created": true,
  "template": "team-outings",
  "project": {
    "id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "name": "Offsite Co",
    "slug": "offsite-co"
  },
  "environment": "dev",
  "summary": {
    "demo_logins": [
      "host@demo…",
      "hr@demo…",
      "ops@demo…"
    ]
  }
}

Source: internal/svc/agentapi/transport/tools.json:411

save_templatewrites

Save as a private template. Save the project's code-first files as a private app template only its workspace sees. Accounts, demo passwords, credentials and secrets are left out (requires.secrets names them); seed rows only with include_seeds. Needs apply and a plan with private templates.

Scope
apply, on a plan with private templates
Output
Saves the project's code-first tree as a private app template only your workspace sees. Accounts, demo passwords, credential columns and token-shaped strings are left out, secrets are never copied, and seed rows come along only with include_seeds.
Errors
PLAN_REQUIRED (403); JSON_RETIRED (409) for a project that is still a JSON contract.

Input schema

NameTypeDescription
categoryoptional"bookings" | "payments" | "teams" | "collaboration" | "notifications" | "reporting" | "commerce" | "health" | "learning" | "finance" | "productivity" | "support" | "ai" | "events" | "hospitality" | "ui" | "sales" | "marketing" | "operations"
descriptionoptionalstringWhat the template is for (its first sentence is the summary) (max 1200)
include_seedsoptionalbooleanBring the project's sample rows (credential columns removed); default false: empty tables
namerequiredstringThe template's name (min 1, max 80)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
Tool call
{
  "name": "save_template",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "name": "Acme intake",
    "description": "Our standard client intake app",
    "include_seeds": false
  }
}
Result (text content)
{
  "template": {
    "slug": "acme-intake",
    "kind": "app",
    "private": true
  }
}

Source: internal/svc/agentapi/transport/tools.json:472

Try it as your users

Call the running app, look at it, run workflows without side effects, and ask why.

call_appwrites

Call the running app. Send one request to the running app (dev or prod) and see what it answered. The answer has status, headers, body (json parsed), duration and identity. kind http {method, path, headers, body | input}, action {name, input} (a server action), topic {name, input}, webhook {name, input | body} (a workflow's inbound webhook, as an outside sender), page {path} (title and visible text). as: visitor (default), user {user_id | role, workspace?} (demo password sign-in, else asserted by the server key), server, none. Writes need apply (dev) or deploy + confirm_production (prod). Details: get_guide {section: "tools", topic: "call_app"}.

Scope
read for GET, HEAD, OPTIONS and pages; apply for other dev methods; deploy and confirm_production for prod writes
Output
What the running app answered to one request made from inside the platform: status, headers, body (and json when it is JSON), duration and identity (who sent it and, in a team app, the workspace). as: a visitor, a user by id, email or role (its demo login, else its oldest user; workspace picks another of theirs), the server key, or none. kind page answers the page's title and visible text, with error_hint when the HTML shows an error.

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
kindoptional"http" | "action" | "topic" | "webhook" | "page"http (default), action, topic, webhook or page
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
methodoptional"GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"http: GET (default), POST, PUT, PATCH, DELETE, HEAD or OPTIONS
pathoptionalstringhttp / page: the path on the app's host, with its query string (max 4096)
headersoptionalobjectExtra request headers
bodyoptionalstringhttp / webhook: the raw request body (input sends JSON instead) (max 1048576)
nameoptionalstringaction, topic or webhook: its name (max 200)
inputoptionalunknownJSON: the action's input, the topic's payload, the webhook's or http request's JSON body
asoptional{ kind?: "visitor" | "user" | "server" | "none"; user_id?: string; role?: string; session?: string; workspace?: string }Who sends the request (default a signed-out visitor; a webhook defaults to none)
confirm_productionoptionalbooleanRequired for a request that can change production
Tool call
{
  "name": "call_app",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "kind": "action",
    "name": "confirmBooking",
    "input": {
      "booking": "5d0c…"
    },
    "as": {
      "kind": "user",
      "role": "ops"
    }
  }
}
Result (text content)
{
  "kind": "action",
  "name": "confirmBooking",
  "status": 200,
  "ms": 84,
  "as": {
    "kind": "user",
    "role": "ops"
  },
  "json": {
    "ok": true,
    "result": {
      "ref": "BK-ACME1",
      "status": "confirmed"
    },
    "runId": "…"
  }
}

Source: internal/svc/agentapi/transport/tools.json:4419

screenshotread-only

Screenshot the app. See the app as a user does: a real browser on the DEV preview (or env "prod") at 390×844 unless width/height, signed in as a demo role (as: a persona id or demo email; "guest": signed out), at `route`, running `steps` (click by text, fill a label, drag, press, wait, go); the first failing step stops and is named. Returns one JPEG (format "png"), page errors, horizontal overflow and the visible text. Every picture stays in your context: shoot each page once before verify, then only pages you changed. Details: get_guide {section: "tools", topic: "screenshot"}.

Scope
read
Output
One picture of the app in a real browser at phone size (390×844 unless you pass width and height), signed in as a demo role or as guest, after the steps you give (click by text, fill a label, drag, press, wait, goto): a JPEG unless format: "png", its long edge at most max_edge (default 1600; a full page is shrunk to fit). A walk of steps returns only its last picture, each step's outcome in steps. Also page errors, horizontal overflow and the visible text; a failing step stops and is named in failed_step. Every picture stays in the agent's context: shoot each page once before verify, then only the pages you changed.

Input schema

NameTypeDescription
asoptionalstringPersona id, demo login email, or "guest" (signed out)
envoptional"dev" | "prod"Which app: "dev" (the preview, default) or "prod" (the published app)
formatoptional"jpeg" | "png""jpeg" (default) or "png" (lossless)
stepsoptionalArray<{ click?: string; drag?: { from: string; to: string; from_handle?: string; to_handle?: string }; fill?: { label: string; value: string }; goto?: string; press?: "Enter" | "Tab" | "Escape" | "Backspace" | "Space" | "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight"; wait?: string; wait_ms?: number }>Up to 20 interactions after the route opens, in order; each sets exactly one key (at most 20 items)
full_pageoptionalbooleanCapture the whole scrollable page
heightoptionalnumber (≥ 480, ≤ 1200)
max_edgeoptionalnumberLongest edge in pixels (default 1600; a full page is shrunk to fit) (≥ 320, ≤ 4000)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
routeoptionalstringApp route, e.g. /people or /chat/<id> (default: where sign-in lands)
widthoptionalnumber (≥ 320, ≤ 1600)
Tool call
{
  "name": "screenshot",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "route": "/experiences",
    "as": "hr",
    "steps": [
      {
        "click": "Pottery Jam"
      },
      {
        "fill": {
          "label": "Team size",
          "value": "12"
        }
      },
      {
        "click": "Request booking"
      },
      {
        "wait": "Requested"
      }
    ]
  }
}
Result (text content)
{
  "ok": true,
  "url": "/bookings",
  "signedInAs": "hr",
  "viewport": {
    "width": 390,
    "height": 844
  },
  "errors": [],
  "overflowX": false,
  "steps": [
    {
      "index": 0,
      "ok": true,
      "ms": 310
    }
  ],
  "text": "Bookings BK-ACME1 requested …"
}

Source: internal/svc/agentapi/transport/tools.json:630

workflowswrites

Workflows. What is armed in an env and how it fires. list: each workflow's trigger (cdc, cron, webhook, call, manual), paused, steps, last run and 24 h / 7 d counts; get {id}: plus definition and recent runs. pause / resume {id} (apply; deploy on prod). dry_run {id, row | input, as?}: runs it once writing nothing; writes, messages and calls come back as effects, waits return at once. Needs read. Details: get_guide {section: "tools", topic: "workflows"}.

Scope
read for list, get and dry_run; apply (dev) or deploy (prod) to pause and resume
Output
What is armed and how it fires: each workflow's trigger (data change, schedule with its next run, webhook URL, action), paused or not, its steps, last run and 24 h / 7 d numbers. dry_run runs a workflow once with nothing written: writes, emails, SMS, notifications, integration calls and signals come back as effects; sleeps return at once and waits answer null.
Errors
WORKFLOW_NOT_FOUND (404), NOT_PAUSABLE (400).

Input schema

NameTypeDescription
actionrequired"list" | "get" | "pause" | "resume" | "dry_run"dry_run: run the workflow (or action) once with nothing written
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
idoptionalstringWorkflow id (get, pause, resume)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
rowoptionalobjectdry_run: the trigger row a data workflow gets (a webhook workflow: the request body)
inputoptionalunknowndry_run: an action's input
eventoptionalobjectdry_run: the event the code gets (default: a manual event)
asoptional{ role: string; user_id?: string; workspace?: string }dry_run: run as this role's app user (default: the workflow's own identity)
allow_httpoptionalbooleandry_run: let ctx.http.fetch reach the network (default: refused)
Tool call
{
  "name": "workflows",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "dry_run",
    "id": "bookingConfirmed",
    "row": {
      "id": "5d0c…",
      "ref": "BK-ACME1",
      "email": "offsite@acme.test",
      "team_size": 12,
      "status": "confirmed"
    }
  }
}
Result (text content)
{
  "ok": true,
  "effects": [
    {
      "op": "email",
      "args": {
        "to": "offsite@acme.test",
        "subject": "Booking BK-ACME1 is confirmed"
      }
    },
    {
      "op": "sleep",
      "args": {
        "duration": "1d"
      }
    },
    {
      "op": "waitFor",
      "args": {
        "name": "feedback"
      },
      "result": null
    }
  ],
  "duration_ms": 41
}

Source: internal/svc/agentapi/transport/tools.json:1882

runwrites

Run workflows. Workflow runs. workflow {id, input, as?}: run it now (dev default); a server function answers inline, others queue (status and result within 30 s). get_run {runId}: log, input, steps. runs: newest first (env, workflow, status, since/until, cursor). cancel {runId}. dead_letters. replay {ids | runId, from_step?}. Writes need apply (dev) or deploy (prod). Pause triggers with workflows. Details: get_guide {section: "tools", topic: "run"}.

Scope
read for get_run, runs and dead_letters; apply (dev) or deploy (prod) to run, cancel and replay
Output
workflow: run a workflow or action now with input (as a role when given); get_run: one run with its steps, outputs, errors and log lines; runs: a page of runs; cancel; dead_letters; replay (all dead letters, or one run from a step).
Errors
RUN_CONFLICT (409) when cancelling a finished run.

Input schema

NameTypeDescription
actionrequired"workflow" | "get_run" | "dead_letters" | "replay" | "runs" | "cancel"
asoptional{ role: string; user_id?: string; workspace?: string }
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
idoptionalstringWorkflow id (action workflow)
idsoptionalArray<string>Dead-letter job ids (action replay)
inputoptionalobjectThe workflow's input (its trigger payload)
limitoptionalnumber (≥ 1, ≤ 200)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
runIdoptionalstringRun id (action get_run)
from_stepoptionalnumberreplay with runId: the step to replay from (0-based; earlier steps must have completed) (≥ 0)
workflowoptionalstringaction runs: only this workflow's runs
statusoptionalstringaction runs: queued, running, succeeded, failed, dead or cancelled (comma list)
sinceoptionalstringaction runs: runs created since (15m, 2h, 7d or an ISO time)
untiloptionalstringaction runs: runs created before (15m, 2h, 7d or an ISO time)
cursoroptionalstringaction runs: next_cursor from the previous page
Tool call
{
  "name": "run",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "workflow",
    "id": "confirmBooking",
    "input": {
      "booking": "5d0c…"
    },
    "as": {
      "role": "ops"
    }
  }
}
Result (text content)
{
  "runId": "r_8c1d…",
  "status": "succeeded",
  "result": {
    "ref": "BK-ACME1",
    "status": "confirmed"
  }
}

Source: internal/svc/agentapi/transport/tools.json:1611

message_previewsread-only

Message previews. Every email, SMS, notification and prompt template of the dev draft rendered with its sample: subject, HTML and text (an email as it would be sent: in the app's email layout and brand, with from and replyTo), or what stops it rendering. Read-only.

Scope
read
Output
Every email, SMS, notification and AI prompt template in the draft (messages/, prompts/) rendered with its front matter's sample: subject, HTML and text, or what stops it rendering.

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
Tool call
{
  "name": "message_previews",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b"
  }
}
Result (text content)
{
  "previews": [
    {
      "channel": "email",
      "name": "booking-confirmed",
      "subject": "Booking BK-1234 is confirmed",
      "text": "You're booked …",
      "html": "<!doctype html>…"
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:5358

rolesread-only

Roles and access. Who can do what in the app (dev or prod): each role from app.config.ts (kind, sign-up, members, profile table, pages), how sign-up works, and every table's row-level security policies. Prove one case with explain {about: "access"} or call_app; verify {checks: ["matrix"]} tests all.

Scope
read
Output
Each role from app.config.ts with its kind, sign-up mode, member count, profile table and the pages it may open; how sign-up works; and every table's row-level security policies as the database has them (name, command, using, with_check).

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
Tool call
{
  "name": "roles",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b"
  }
}
Result (text content)
{
  "env": "dev",
  "roles": [
    {
      "id": "hr",
      "kind": "consumer",
      "signup": "self",
      "members": 2,
      "profile": {
        "table": "hr_profile"
      },
      "pages": [
        {
          "route": "/bookings",
          "title": "Bookings"
        }
      ]
    }
  ],
  "policies": [
    {
      "table": "booking",
      "rls": true,
      "policies": [
        {
          "name": "booking_hr_read",
          "command": "SELECT",
          "using": "(hr_id = ( SELECT ctx.profile_id('hr')))"
        }
      ]
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:5153

explainread-only

Explain. Answer "why", changing nothing. access {table, op, as: "admin" | "guest" | {role, user_id, workspace}, id?, values?}: the verdict, the deciding layer, each step and RLS policy, and a fix (real checks, rolled back). request {trace_id | path}: a logged request explained. error {code}: the catalogue entry. check {check_id}: a check of the last verify. Needs read. Details: get_guide {section: "tools", topic: "explain"}.

Scope
read (never writes)
Output
Why. access: whether a role may read, create, update or delete rows of a table, which layer decided (gate, rls with each policy and whether it passes on the row, a trigger's refusal, lifecycle, not_found), and a fix hint; the checks (and the write, with values) run in a transaction that is rolled back. request: a logged request by trace_id, its access explanation and the workflow runs it started. error: a code's meaning and fix. check: one check of the last verify report.
Errors
REQUEST_NOT_FOUND (the request log keeps 24 hours), UNKNOWN_CODE, CHECK_NOT_FOUND.

Input schema

NameTypeDescription
aboutrequired"access" | "request" | "error" | "check"
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
tableoptionalstringaccess: the table (entity) (max 63)
opoptional"read" | "create" | "update" | "delete"access: what the role tries
asoptional"admin" | "guest" | { role: string; user_id?: string; workspace?: string }access: "admin" (default), "guest" (signed out) or {role, user_id}
idoptionalstring | numberaccess: the row (read, update, delete) (max 200)
valuesoptionalobjectaccess: the new row (create) or the patch (update); without them the write isn't run
trace_idoptionalstringrequest: the trace id (tail's trace_id) (max 200)
pathoptionalstringrequest: the request path instead of a trace id (the newest match) (max 500)
statusoptionalnumberrequest: with path, only this status (≥ 100, ≤ 599)
sinceoptionalstringrequest: how far back to look (15m, 2h, 1d or ISO; default 24h) (max 40)
codeoptionalstringerror: the code (e.g. RULE_REFUSED) (max 80)
check_idoptionalstringcheck: the id of a check in the last verify report (max 200)
Tool call
{
  "name": "explain",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "about": "access",
    "table": "booking",
    "op": "read",
    "as": {
      "role": "hr"
    },
    "id": "5d0c…"
  }
}
Result (text content)
{
  "verdict": "denied",
  "decided_by": "rls",
  "steps": [
    {
      "layer": "gate",
      "ok": true
    },
    {
      "layer": "rls",
      "ok": false,
      "policies": [
        {
          "name": "booking_hr_read",
          "passes": false
        }
      ]
    }
  ],
  "code": "TABLE_FORBIDDEN",
  "fix_hint": "No select policy lets hr read this row: …"
}

Source: internal/svc/agentapi/transport/tools.json:2919

verifyread-only

Verify. Run appbricx verify on DEV (or env "prod"): static → data (demo sign-ins, role × table matrix, signed-out access, workflows) → browser. Re-runs only what changed since a passing run (report.reused says what it took: "unchanged since run X"); full: true runs everything. On status "running" call again. checks: only some areas; last: true: the last stored report. Failing checks carry evidence and a fix; passing ones are shortened unless detail. artifact: a check's saved screenshot as a picture. 'skipped' is never 'pass'.

Scope
read
Output
The verify report: static checks (types, lint, reachability), the role × table matrix with rolled-back writes as every role and as a signed-out visitor, workflows armed, and a browser walk of every page as each role. It re-runs only what changed since a passing run (report.reused says what it took); full: true runs everything. Each failing check has evidence and a fix; passing ones are shortened unless detail: true; skipped is never pass. last: true answers the last stored report; artifact answers a check's saved file (a screenshot as the picture). Takes minutes: an answer of status running means call again to join the same run.

Input schema

NameTypeDescription
artifactoptionalstringAnswer this saved file instead of running verify: a key from a check's artifacts (or its part after verify/, e.g. "<run>/builder-dashboard-390.png"); a screenshot comes back as the picture (max 400)
checksoptionalArray<"static" | "matrix" | "production" | "browser">Only these check areas (default: all) (at least 1 items, at most 4 items)
detailoptionalbooleanThe whole report, passing checks included (default: shortened)
envoptional"dev" | "prod"Which app to verify: "dev" (the preview, default) or "prod" (the published app)
fulloptionalbooleanRun every area and walk every page, even those unchanged since a passing run (default: only what changed)
lastoptionalbooleanAnswer the env's last stored report without running verify (REPORT_NOT_FOUND when there is none)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
Tool call
{
  "name": "verify",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "checks": [
      "matrix",
      "browser"
    ]
  }
}
Result (text content)
{
  "ok": false,
  "summary": {
    "passed": 41,
    "failed": 1,
    "skipped": 0
  },
  "failed": [
    {
      "id": "matrix.booking.hr.read_other",
      "title": "hr reads another company's booking",
      "evidence": "GET /__appbricx/api/v1/booking as hr@demo… returned 2 rows of hr_profile Globex",
      "fix": "Limit booking_hr_read to hr_id = ctx.profile_id('hr')"
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:571

jobread-only

Job. Read a long tool's job by the job_id its answer gave. Long tools: deploy, verify, use_template, restores, rollbacks, applies, a write's then: check/apply. Answers status running | succeeded | failed, progress and, once finished, result: the tool's own answer. Kept 24 hours; only the credential that started it may read it. Reading a finished job collects it.

Scope
the credential that started the job
Output
A long tool's job (deploy, verify, use_template, restores, rollbacks, applies, a write's then: check or apply): status running, succeeded or failed, progress, and once finished the tool's own answer. Jobs are kept 24 hours and only the credential that started one reads it. Reading a finished job collects it.
Errors
JOB_NOT_FOUND.

Input schema

NameTypeDescription
job_idrequiredstringThe job_id from a long tool's answer (min 1, max 100)
Tool call
{
  "name": "job",
  "arguments": {
    "job_id": "j_41…"
  }
}
Result (text content)
{
  "job_id": "j_41…",
  "tool": "verify",
  "status": "running",
  "progress": {
    "fraction": 0.6,
    "message": "browser: /bookings as ops"
  }
}

Source: internal/svc/agentapi/transport/tools.json:1796

Data and files

Read and change rows, run SQL, move data in and out, and manage the project's stored files.

query_dataread-only

Query data. Read rows of a table of the built app (dev or prod), read-only: as admin (past row-level security) or as: {role, user_id, workspace} (what that user sees). where, filter [{field, op, value}], search, fields, order_by/desc, limit (≤ 200) with next_cursor, count, aggregate {group_by, bucket, metrics}. Names are checked against the model (400 BAD_QUERY names alternatives); the SQL run is echoed in query. Needs read. Details: get_guide {section: "tools", topic: "query_data"}.

Scope
read
Output
Rows of a table, dev or prod, read-only: as the admin (past row-level security) or as an app user (as: {role, user_id, workspace}: what they would see). where, filter, search, fields, order_by, a cursor for the next page, count, and aggregate (group, time buckets, metrics). Every answer echoes the SQL it ran with its bound params.
Errors
BAD_QUERY (400) naming the closest columns; NOT_BUILT before an apply; PROD_NOT_PROVISIONED before a deploy.

Input schema

NameTypeDescription
aggregateoptional{ bucket?: { field: string; tz?: string; unit: "hour" | "day" | "week" | "month" | "quarter" | "year" }; group_by?: Array<string>; metrics?: Array<string> }Group and count instead of listing rows
asoptionalstring | { role: string; user_id?: string; workspace?: string }"admin" (default: every row, past row-level security) or {role, user_id}: read as that app user
countoptionalbooleanAlso answer total: the rows matching the filters
cursoroptionalstringnext_cursor of the previous page (same query) (max 2048)
descoptionalbooleanDescending (default true)
entityrequiredstringEntity (table) name, as in the contract's entities[].name (min 1)
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
fieldsoptionalArray<string>Columns to answer (default all) (at least 1 items, at most 100 items)
filteroptionalArray<{ field: string; op: "eq" | "neq" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "is_null" | "is_not_null"; value?: unknown }>Comparisons, all ANDed (@app/kit's AppFilter): [{field, op, value}] (at most 30 items)
limitoptionalnumber (≥ 1, ≤ 200)
order_byoptionalstringColumn to order by (default created_at)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
searchoptional{ field?: string; q: string }Case-insensitive substring search on field (default: the table's search columns)
whereoptionalobjectColumn → value equality filters
Tool call
{
  "name": "query_data",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "entity": "booking",
    "where": {
      "status": "requested"
    },
    "as": {
      "role": "hr"
    },
    "limit": 20
  }
}
Result (text content)
{
  "rows": [
    {
      "id": "5d0c…",
      "ref": "BK-ACME1",
      "status": "requested",
      "team_size": 12
    }
  ],
  "rowCount": 1,
  "next_cursor": null,
  "query": {
    "sql": "select … from booking where status = $1 order by created_at desc limit 50",
    "params": [
      "requested"
    ]
  }
}

Source: internal/svc/agentapi/transport/tools.json:781

sql_queryread-only

Query with SQL (read-only). Run read-only SQL (SELECT, WITH, VALUES, TABLE, SHOW, EXPLAIN) on dev or prod in a rolled-back READ ONLY transaction, as the tenant admin or as: {role, user_id, workspace} under row-level security. Never writes, so it needs only read; a writing statement is refused (SQL_NOT_READ_ONLY). Answers like sql. params bind $1…; explain: the plan. Catalog names are refused: use describe_schema. Details: get_guide {section: "tools", topic: "sql_query"}.

Scope
read
Output
Read-only SQL: SELECT, WITH … SELECT, VALUES, TABLE, SHOW or EXPLAIN, in a read-only transaction that is rolled back, as the tenant admin or as an app user (as) under row-level security. The same answer as sql's for a read: rows of the last statement that returned rows (max 1000), each statement's count, timing. It never writes, so MCP clients run it without asking; use sql for writes.
Errors
SQL_NOT_READ_ONLY (400) when a statement writes or changes the schema: nothing ran; use sql. A SELECT of a function that writes fails in the read-only transaction (pgCode 25006): run it with sql {commit: true}.

Input schema

NameTypeDescription
asoptionalstring | { role: string; user_id?: string; workspace?: string }"admin" (default: the tenant admin, past row-level security) or {role, user_id}: read as that app user
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
explainoptionalbooleanAnswer the statement's plan (EXPLAIN ANALYZE, BUFFERS; one statement; rolled back)
paramsoptionalArray<string | number | boolean | null>Values for $1, $2, … (one statement only) (at most 100 items)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
sqlrequiredstringOne or more read-only SQL statements (SELECT, WITH … SELECT, VALUES, TABLE, SHOW, EXPLAIN) (min 1)
Tool call
{
  "name": "sql_query",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "sql": "select o.name, count(p.id)::int as projects from organisation o left join project p on p.organisation_id = o.id where o.name ilike $1 group by o.name",
    "params": [
      "%coffee%"
    ]
  }
}
Result (text content)
{
  "rows": [
    {
      "name": "Lumen Coffee",
      "projects": 3
    }
  ],
  "rowCount": 1,
  "truncated": false,
  "statements": [
    {
      "sql": "select o.name, count(p.id)::int as projects from organisation o …",
      "command": "SELECT",
      "rowCount": 1
    }
  ],
  "env": "dev",
  "readOnly": true,
  "durationMs": 6
}

Source: internal/svc/agentapi/transport/tools.json:1230

sqlwrites

Run SQL. Run SQL on dev or prod: several statements in one transaction, DDL and DML, as the tenant admin (past row-level security) or as: {role, user_id, workspace} (that app user, under RLS). Returns rows (≤ 1000), rowCount, statements and durationMs. A read-only script needs read; writes need apply (dev) or deploy (prod), and a prod write takes a snapshot first (snapshotId). params bind $1…; explain, dry_run, commit. Lasting schema changes belong in db/. To only read use sql_query; for one table query_data. Details: get_guide {section: "tools", topic: "sql"}.

Scope
read for a script that only reads; apply (dev) or deploy (prod) for writes
Output
Any SQL in one transaction, as the tenant admin or as an app user (as) under row-level security: rows of the last statement that returned rows (max 1000), each statement's count, timing. params for $1…, explain (the plan, rolled back), dry_run (runs and rolls back). A prod write takes a snapshot first (snapshotId).
Errors
A refused statement answers Postgres's message with statementIndex, position and pgCode.

Input schema

NameTypeDescription
asoptionalstring | { role: string; user_id?: string; workspace?: string }"admin" (default: the tenant admin, past row-level security) or {role, user_id}: run as that app user
commitoptionalbooleanCommit a script that reads as read-only (SELECT fn() whose function writes); needs the write scope
dry_runoptionalbooleanRun the script and roll it back: row counts, nothing kept, no snapshot
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
explainoptionalbooleanAnswer the statement's plan (one statement; nothing is kept)
paramsoptionalArray<string | number | boolean | null>Values for $1, $2, … (one statement only) (at most 100 items)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
sqlrequiredstringOne or more SQL statements (min 1)
Tool call
{
  "name": "sql",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "sql": "select count(*)::int as n from booking where status = $1",
    "params": [
      "requested"
    ]
  }
}
Result (text content)
{
  "columns": [
    {
      "name": "n",
      "type": "int4"
    }
  ],
  "rows": [
    {
      "n": 2
    }
  ],
  "rowCount": 1,
  "statements": [
    {
      "command": "SELECT",
      "rowCount": 1
    }
  ],
  "durationMs": 4
}

Source: internal/svc/agentapi/transport/tools.json:1159

edit_rowswrites

Edit rows. Insert, update, delete or transition rows through the app's own data API: access rules, before-write rules, lifecycle guards, RLS and change events behave as in the app. insert: rows (≤ 100); update: id/ids + patch; delete: id/ids; transition: id/ids + to (field). as: "admin" (default, elevated) or {role, user_id, workspace}. One result per row. Needs apply (dev) or deploy (prod; snapshotted first).

Scope
apply (dev), deploy (prod)
Output
Insert, update, delete or transition rows through the app's own data API, so your policies, triggers and workflows behave as in the app. One result per row. A prod write takes a snapshot first.

Input schema

NameTypeDescription
asoptionalstring | { role: string; user_id?: string; workspace?: string }
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
idoptionalstring | numberRow id to update or delete
idsoptionalArray<string | number>Row ids to update or delete (at least 1 items, at most 100 items)
oprequired"insert" | "update" | "delete" | "transition"
patchoptionalobjectColumn values to set (update)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
rowsoptionalArray<object>Rows to insert (at least 1 items, at most 100 items)
tablerequiredstringTable (entity) name (min 1)
fieldoptionalstringtransition: the lifecycle field (default: the table's lifecycle field)
tooptionalstringtransition: the state to move to
Tool call
{
  "name": "edit_rows",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "table": "booking",
    "op": "update",
    "id": "5d0c…",
    "patch": {
      "notes": "Asked for a vegetarian lunch"
    },
    "as": {
      "role": "ops"
    }
  }
}
Result (text content)
{
  "results": [
    {
      "ok": true,
      "id": "5d0c…"
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:1379

describe_schemaread-only

Describe schema. The real schema of the dev or prod database: tables (columns, keys, constraints, indexes, triggers, policies), views, functions, enums. Each table's origin: contract (db/ files manage it), platform, internal (_appbricx_*) or hand-made.

Scope
read
Output
The real schema of dev or prod: tables with columns, keys, constraints, indexes, triggers and policies; views, functions and enums. Each object says whether db/ declares it, the platform made it, or it was made by hand.

Input schema

NameTypeDescription
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
Tool call
{
  "name": "describe_schema",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "env": "prod"
  }
}
Result (text content)
{
  "tables": [
    {
      "name": "booking",
      "origin": "contract",
      "columns": [
        {
          "name": "status",
          "type": "text",
          "nullable": false,
          "default": "'requested'::text"
        }
      ],
      "policies": [
        "booking_hr_read",
        "booking_ops_all"
      ]
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:1476

data_transferwrites

Export, import, seed, copy data. Move data in and out (env dev or prod). export {tables?, where, limit, inline}: CSV or JSON files at signed URLs (1 hour). import {table, rows | csv, through: "rules" (default, as admin or a persona; refused rows reported) | "bulk"} (≤ 5000 rows). copy {from_env, to_env}: replaces the target database (snapshotted first). Prod writes and copies are dry runs until dry_run: false. Export needs read; import apply (prod: deploy). Details: get_guide {section: "tools", topic: "data_transfer"}.

Scope
read for export and dry runs; apply (dev) or deploy (prod) for import; deploy for a copy into prod
Output
export: tables to CSV or JSON files with signed links (1 hour). import: rows or CSV through the app's own write path (rules) or straight in (bulk), each refused row named. copy: replace one environment's database with the other's, snapshotting the target first. Prod writes and every copy are dry runs until dry_run: false.

Input schema

NameTypeDescription
actionrequired"export" | "import" | "copy"
asoptionalstring | { role: string; user_id?: string; workspace?: string }import through rules: write as "admin" (default; rules still run) or as a persona
csvoptionalstringimport: CSV text with a header row (empty cells are null) (max 4000000)
dry_runoptionalbooleantrue: check and count, write nothing. Default: false on dev imports; true on prod and for copy
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
formatoptional"csv" | "json"export: csv (default) or json
from_envoptional"dev" | "prod"copy: the source (default dev)
inlineoptionalnumberexport: also answer up to this many rows inline (at most 200 over all tables) (≥ 0, ≤ 200)
limitoptionalnumberexport: rows per table (default and max 100000) (≥ 1, ≤ 100000)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
rowsoptionalArray<object>import: the rows, as objects of column values (at most 5000 items)
tableoptionalstringimport: the table
tablesoptionalArray<string>export: the tables (default: every app table) (at most 100 items)
throughoptional"rules" | "bulk"import: rules (default) or bulk
to_envoptional"dev" | "prod"copy: the target, replaced (default prod)
whereoptionalobjectexport: keep rows whose columns equal these values
Tool call
{
  "name": "data_transfer",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "export",
    "tables": [
      "booking"
    ],
    "format": "csv"
  }
}
Result (text content)
{
  "files": [
    {
      "table": "booking",
      "rows": 2,
      "bytes": 612,
      "url": "https://appbricx.com/api/exports/…"
    }
  ],
  "expires_at": "2026-10-28T11:02:00Z"
}

Source: internal/svc/agentapi/transport/tools.json:3332

snapshotswrites

Database snapshots. Database snapshots of dev or prod (every publish and prod agent write takes one). list (read); create (apply; default env prod); restore {id} (deploy: replaces the whole database, snapshotting the current state first: undoSnapshotId); download {id}: a signed link to the dump.

Scope
read to list; apply to create; deploy to restore; download needs read
Output
Database snapshots (pg_dump) of dev or prod. Every publish and every agent write on prod takes one. A restore replaces the database and first snapshots the current state (undoSnapshotId). download: a signed link to the dump (about an hour).

Input schema

NameTypeDescription
actionrequired"list" | "create" | "restore" | "download"
envoptional"dev" | "prod"
idoptionalstringSnapshot id (from list): the one to restore or download
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
Tool call
{
  "name": "snapshots",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "list",
    "env": "prod"
  }
}
Result (text content)
{
  "snapshots": [
    {
      "id": "s_19…",
      "env": "prod",
      "reason": "deploy 7",
      "created_at": "2026-10-28T09:51:20Z",
      "bytes": 482113
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:1502

migrationswrites

Schema migrations. An env's schema journal. list: each migration (mode, statements, skipped destructive changes, snapshot). plan: the SQL dev's db/ would run (a dry run). rollback {to_migration?}: a dry run unless dry_run: false; snapshots first; a long tool (job_id). list and plan need read; rollback apply (dev) or deploy (prod). Details: get_guide {section: "tools", topic: "migrations"}.

Scope
read for list and plan; apply (dev) or deploy (prod) to roll back
Output
The schema journal of an environment: each migration with its statements and the snapshot taken before it; plan: what the current dev files would run; rollback: a dry run listing what would be undone, then (dry_run: false) undo it as a long job.
Errors
CONFIRM_REQUIRED (428) on prod without dry_run: false; NOTHING_TO_ROLL_BACK; ROLLBACK_REFUSED.

Input schema

NameTypeDescription
actionrequired"list" | "plan" | "rollback"
allow_destructiveoptionalbooleanplan: plan a full migration (drops and narrowing type changes run)
dry_runoptionalbooleanrollback: default true (show what would be undone); false runs it
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
to_migrationoptionalnumberrollback: the migration id (from list) the database should match; 0 or omitted undoes the latest (≥ 0)
Tool call
{
  "name": "migrations",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "list",
    "env": "dev"
  }
}
Result (text content)
{
  "migrations": [
    {
      "id": "m_31",
      "mode": "expand",
      "applied_at": "2026-10-28T09:40:02Z",
      "statements": 2,
      "reversible": true
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:2381

storagewrites

Project storage. Project files, assets, backups, exports. get, usage, test, list {area, prefix}, link | read {path | key}. Writes: upload {area, folder, name, base64 | text | url (≤ 100 MB: clips, PDFs)}, delete, move {path, to, keep_old}, mkdir, rmdir {area, folder}, permissions {path, permissions} (who may open a file; read: ["any"]: public, signed out too). Details: get_guide {section: "tools", topic: "storage"}.

Scope
read for get, usage, list, link, read and test; apply for upload, delete, move, mkdir, rmdir and permissions (in run_script, delete, move, rmdir and permissions also need allow)
Output
The project's stored objects by area: files (uploads, served at /media/<id>/<name>), assets (/assets/<name>), backups (database snapshots) and exports, wherever the project keeps them. get (default): the effective backend (kind, provider, bucket, prefix, the key id masked, never the secret) and its source (project, workspace or appbricx). usage: objects and bytes per area. test: whether the backend answers. list {area, prefix, limit, cursor}: one folder's items, newest first, 25 a page (up to 100), each compact (name, path or key, size, type, updated_at, area, folder, env, file_id, permissions), and its subfolders in folders; detail: true adds key, url and thumb_url. link: one signed URL (15 minutes). read: text inline up to 100 KB, an image (PNG, JPEG, GIF, WebP) as a picture scaled to 1024 px, anything else its metadata and a link. upload {area: files | assets, folder?, name, base64 | text | url}: one file with the console's checks (assets: video up to 100 MB, audio and PDFs 25 MB, the rest 10 MB); url is a public http(s) address the server fetches and streams to storage (at most 100 MB): the way to upload a clip. delete: a file with its image variants and row, an asset or an export (backups belong to snapshots). move {path | key, to, replace?, keep_old?}: a file keeps its /media address; an asset gets a new one, and keep_old leaves a copy at the old. mkdir and rmdir {area, folder, recursive?}. permissions {path | key, permissions}: who besides the uploader may read, update (re-share) and delete a file; {} clears them; read: ["any"] makes it public, open to signed-out visitors. No action reads or sets the bucket or its credentials: a workspace owner or admin does that in the console.
Errors
FORBIDDEN (403) for a key outside the project; STORAGE_PROTECTED for backups, image variants and folder markers; NOT_FOUND (404). ALREADY_EXISTS (409) on a move unless replace; FOLDER_NOT_EMPTY (409) on rmdir unless recursive. BAD_ASSET, TOO_LARGE, FETCH_FAILED (a url that can't be fetched); USER_NOT_FOUND, INVALID_PERMISSIONS (422).

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
actionoptional"get" | "usage" | "list" | "link" | "read" | "test" | "upload" | "delete" | "move" | "mkdir" | "rmdir" | "permissions"
areaoptional"files" | "assets" | "backups" | "exports"default files
prefixoptionalstringlist: a folder (max 512)
cursoroptionalstring (max 64)
limitoptionalnumber1-100, default 25 (≥ 1, ≤ 100)
detailoptionalboolean+ key, url, thumb_url
pathoptionalstring (max 1024)
keyoptionalstring (max 1024)
tooptionalstring (max 300)
replaceoptionalboolean
keep_oldoptionalboolean
folderoptionalstring (max 200)
recursiveoptionalboolean
nameoptionalstring (max 200)
base64optionalstring (max 14000000)
textoptionalstring (max 1048576)
urloptionalstringpublic http(s) (max 2048)
content_typeoptionalstring (max 100)
permissionsoptional{ read?: Array<string>; update?: Array<string>; delete?: Array<string>; by_reference?: boolean }
Tool call
{
  "name": "storage",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "list",
    "area": "files",
    "prefix": "contracts/",
    "limit": 25
  }
}
Result (text content)
{
  "action": "list",
  "result": {
    "folder": "contracts",
    "folders": [
      "contracts/signed"
    ],
    "items": [
      {
        "name": "msa-acme.pdf",
        "path": "/media/0c5e…/msa-acme.pdf",
        "size": 182344,
        "content_type": "application/pdf",
        "updated_at": "2026-11-10T09:12:44Z",
        "area": "files",
        "folder": "contracts",
        "env": "prod",
        "file_id": "0c5e…",
        "permissions": {
          "read": [
            "role:legal"
          ],
          "by_reference": false
        }
      }
    ],
    "next_cursor": "…"
  }
}

Source: internal/svc/agentapi/transport/tools.json:5489

Ship and roll back

Production releases, versions, addresses and domains.

deploywrites

Deploy. Publish the app to https://<subdomain>.<publish domain>; takes minutes (on status "running" call again). dry_run: true answers the plan and changes nothing (read scope). A taken host is 409 SUBDOMAIN_TAKEN; verify runs first and refuses on red unless skip_verify. Production migrates additively: destructive changes are skipped and listed, allow_destructive: true runs them after a snapshot (only when the user agrees). The first deploy starts prod from the schema and -- @env prod seeds (first_publish_data). Needs deploy. Details: get_guide {section: "tools", topic: "deploy"}.

Scope
deploy (a dry run needs read)
Output
Publishes what dev runs to https://<subdomain>.apps.appbricx.com. dry_run: true answers the plan and changes nothing. Otherwise the host is checked, the migration is rehearsed on a copy of production and verified there, a red verify stops the release with production untouched, production is snapshotted, and the expand steps run; drops wait (pending_contract) unless allow_destructive. The first deploy starts production from the schema and the -- @env prod seeds (first_publish_data: "copy_dev" copies dev instead). verify and long plans come back shortened unless detail: true. Takes minutes: call again while it answers status running.
Errors
SUBDOMAIN_TAKEN (409), INVALID_SUBDOMAIN (dev- and verify- names are reserved), a red verify report.

Input schema

NameTypeDescription
allow_destructiveoptionalbooleanRun destructive schema changes too: prod is snapshotted, then fully migrated. Only when the user agrees to lose that data (check dry_run first)
detailoptionalbooleanAnswer in full (default: verify and long plans shortened)
demo_resetoptionalbooleanNot supported on this server yet: nothing changes (the answer warns)
environmentoptional"production" | "preview"
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
skip_verifyoptionalboolean
subdomainoptionalstringOne DNS label: lowercase letters, digits, single hyphens (e.g. "tablefor"). Name it after the app.
dry_runoptionalbooleanAnswer the plan only: nothing changes and verify doesn't run (needs only the read scope)
first_publish_dataoptional"seeds" | "copy_dev"First deployment only: "seeds" (default: schema + -- @env prod seeds) or "copy_dev" (a copy of dev's database)
Tool call
{
  "name": "deploy",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "subdomain": "teamday",
    "dry_run": true
  }
}
Result (text content)
{
  "status": "live",
  "url": "https://teamday.apps.appbricx.com",
  "deployment": {
    "id": "d_7…",
    "number": 7
  },
  "migration_mode": "expand",
  "snapshot_id": "s_19…",
  "pending_contract": []
}

Source: internal/svc/agentapi/transport/tools.json:1032

deployswrites

Deploy history. The project's deployments. list / get (deploymentId: also its prod migration); rollback: switch the live site back to an earlier deployment's build (restore_db: true also restores prod's database to the snapshot taken when it was replaced, losing later rows); take_down: the site goes dark (a dry run unless dry_run: false; data stays). list and get need read; rollback and take_down deploy. Details: get_guide {section: "tools", topic: "deploys"}.

Scope
read for list and get; deploy for rollback and take_down
Output
Releases (status, url, snapshot, the version it published, who). get: one release and its migration. rollback: switch an earlier release's stored build back in (dry_run previews it; restore_db also restores the database to the snapshot taken when that release was replaced). take_down: the site goes dark (data, releases and domains stay).
Errors
NO_SNAPSHOT (409) for restore_db without one; NOT_DEPLOYED (409).

Input schema

NameTypeDescription
actionrequired"list" | "rollback" | "get" | "take_down"
deploymentIdoptionalstringThe deployment to roll back to (from list)
environmentoptional"production" | "preview"
limitoptionalnumber (≥ 1, ≤ 100)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
restore_dboptionalbooleanrollback: also restore prod's database as it was when that deployment was replaced (later rows lost)
schemaoptionalbooleanrollback (SQL projects): also drop what later deployments added to prod's schema (values snapshotted first). Not with restore_db
dry_runoptionalbooleantake_down: default true (list what goes dark); rollback: true previews it
Tool call
{
  "name": "deploys",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "rollback",
    "deploymentId": "d_6…",
    "dry_run": true
  }
}
Result (text content)
{
  "deployments": [
    {
      "id": "d_7…",
      "environment": "production",
      "status": "live",
      "url": "https://teamday.apps.appbricx.com",
      "contract_version": 9,
      "actor": {
        "kind": "agent",
        "tokenId": "…"
      },
      "created_at": "2026-10-28T09:51:20Z"
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:1548

versionswrites

App versions. The project's history: every dev apply is a version. list (cursor); get {version, section?}; diff {from, to: "dev", "prod" or a number; default prod → dev; files: true for unified diffs}: what changed and, from an env, the schema plan; restore {version}: a dry run unless dry_run: false (applies it to dev as a new version; needs apply). Details: get_guide {section: "tools", topic: "versions"}.

Scope
read for list, get, diff and a restore's dry run; apply to restore
Output
Every apply is a version. list: newest first with author, time and what changed; get: one version's files; diff: between any two ("dev", "prod" or a number), per file with files: true, plus the schema plan, access (policies), templates and bundle sizes; restore: a dry run unless dry_run: false, which applies that version to dev as a new version (rows kept).
Errors
NOT_DEPLOYED (409) for "prod" before a release.

Input schema

NameTypeDescription
actionrequired"list" | "get" | "diff" | "restore"
cursoroptionalstringlist: next_cursor from the previous page
dry_runoptionalbooleanrestore: default true (show the change only); false applies the version to dev
fromoptionalstring | numberdiff: the older side: "dev", "prod" (default) or a version number
limitoptionalnumber (≥ 1, ≤ 50)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
sectionoptional"app" | "auth" | "personas" | "workflows" | "realtime"get: only this top-level section (app, auth, personas, workflows, realtime)
tooptionalstring | numberdiff: the newer side: "dev" (default), "prod" or a version number
versionoptionalnumberget, restore: a version number (from list) (≥ 1)
filesoptionalbooleandiff: each changed file's unified diff too
Tool call
{
  "name": "versions",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "diff",
    "from": "prod",
    "to": "dev",
    "files": true
  }
}
Result (text content)
{
  "from": "prod",
  "to": "dev",
  "changes": {
    "files": [
      "server/bookings.ts",
      "db/access/booking.sql"
    ],
    "access": [
      {
        "table": "booking",
        "added": [
          "booking_host_read"
        ]
      }
    ]
  },
  "schema": {
    "expand": [],
    "contract": []
  }
}

Source: internal/svc/agentapi/transport/tools.json:2036

routingwrites

App addresses. Where the app answers. get (default): dev URL, production host, custom domains. check_subdomain {subdomain}; set_subdomain {subdomain, confirm} (the old address stops at once; deploy); set_dev_url {name} (the old one redirects; apply). Custom domains: domains.

Scope
read for get and check_subdomain; deploy for set_subdomain; apply for set_dev_url
Output
Where the app answers: the dev URL, production's host (live or not, since which release) and custom domains. Check or move production's subdomain (the old address stops at once; confirm repeats the name), or move the dev site (the old address keeps redirecting).
Errors
SUBDOMAIN_TAKEN, NOT_PUBLISHED (409); CONFIRM_REQUIRED (428).

Input schema

NameTypeDescription
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
actionoptional"get" | "check_subdomain" | "set_subdomain" | "set_dev_url"get (default), check_subdomain, set_subdomain or set_dev_url
subdomainoptionalstringcheck_subdomain / set_subdomain: the production subdomain (max 63)
confirmoptionalstringset_subdomain: the same subdomain again (max 63)
nameoptionalstringset_dev_url: the dev site's new name (without dev-) (max 63)
Tool call
{
  "name": "routing",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "check_subdomain",
    "subdomain": "offsite"
  }
}
Result (text content)
{
  "prod": {
    "host": "teamday.apps.appbricx.com",
    "live": true,
    "release": 7
  },
  "dev": {
    "url": "https://dev-teamday.apps.appbricx.com"
  },
  "domains": []
}

Source: internal/svc/agentapi/transport/tools.json:5237

domainswrites

Custom domains. The published app's custom domains. list (with routing: the canonical host, what redirects where); add {domain}: saved pending, answers the DNS records to set (deploy once first); verify {domain} (DNS_NOT_READY says what's missing); set_primary {domain}: the canonical host (the apps host's pages and the www twin redirect to it); set_redirect {domain, to}: redirect to another of its domains (to: null serves it again); remove {domain}. remove, set_primary and set_redirect are dry runs (answering the routing they would make) unless dry_run: false. Writes need deploy; a paid plan (PLAN_REQUIRED).

Scope
read for list and dry runs; deploy for add, verify, remove, set_primary and set_redirect
Output
Custom domains of the published app and how production routes: add answers the DNS records to set (a CNAME or an A record, plus an ownership TXT); verify checks them; set_primary makes one the canonical host (every canonical URL, the sitemap and robots.txt name it; the .apps address's pages and the www twin redirect to it); set_redirect {to} sends a domain to another (to: null serves it again). remove, set_primary and set_redirect are dry runs answering the routing they would make until dry_run: false. list and set_* answer routing: the canonical host and, per host, whether it serves or where it redirects. Needs a paid plan and a first deploy.
Errors
DNS_NOT_READY (409) naming what's missing; DOMAIN_TAKEN; PLAN_REQUIRED; NOT_PUBLISHED; DOMAIN_NOT_FOUND; BAD_REQUEST for a redirect to itself, to a domain that redirects, or of a domain another one redirects to.

Input schema

NameTypeDescription
actionoptional"list" | "add" | "verify" | "remove" | "set_primary" | "set_redirect"
domainoptionalstring (max 253)
dry_runoptionalbooleantrue (default): answers what would change
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
tooptionalstring | nullset_redirect target domain, or null (max 253)
Tool call
{
  "name": "domains",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "set_primary",
    "domain": "teamday.example",
    "dry_run": false
  }
}
Result (text content)
{
  "action": "set_primary",
  "dry_run": false,
  "domains": [
    {
      "domain": "teamday.example",
      "status": "active",
      "records": []
    }
  ],
  "routing": {
    "canonical": "teamday.example",
    "hosts": [
      {
        "host": "teamday.apps.appbricx.com",
        "kind": "apps",
        "serves": false,
        "redirects_to": "teamday.example"
      },
      {
        "host": "teamday.example",
        "kind": "custom",
        "primary": true,
        "serves": true
      },
      {
        "host": "www.teamday.example",
        "kind": "custom",
        "primary": false,
        "serves": false,
        "redirects_to": "teamday.example"
      }
    ]
  }
}

Source: internal/svc/agentapi/transport/tools.json:3181

Operate

Logs, numbers, accounts, sign-in, secrets and integrations of the running app.

logsread-only

Workflow logs. Recent workflow runs (status, error, last log lines) and in-app notifications, newest first. Filters: env, workflow, status, since (15m, 2h, 7d or ISO); log_lines (default 8). With a filter or cursor the answer pages (next_cursor).

Scope
read
Output
Recent workflow and action runs (status, error, last log lines) and in-app notifications, newest first; filter by env, workflow, status and since, page with cursor.

Input schema

NameTypeDescription
limitoptionalnumber (≥ 1, ≤ 200)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
workflowoptionalstring
envoptional"dev" | "prod"Only this env's runs and notifications (default both)
statusoptionalstringqueued, running, succeeded, failed, dead or cancelled (comma list)
sinceoptionalstringRuns created since (15m, 2h, 7d or an ISO time)
cursoroptionalstringnext_cursor from the previous page
log_linesoptionalnumberHow many of each run's last log lines to show (default 8) (≥ 1, ≤ 200)
Tool call
{
  "name": "logs",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "env": "dev",
    "status": "failed,dead",
    "since": "1d"
  }
}
Result (text content)
{
  "runs": [
    {
      "id": "r_8c1d…",
      "workflow": "bookingConfirmed",
      "env": "dev",
      "status": "waiting",
      "started_at": "…",
      "log": [
        "email booking-confirmed queued",
        "sleep 1d"
      ]
    }
  ],
  "next_cursor": null
}

Source: internal/svc/agentapi/transport/tools.json:979

tailread-only

Tail events and requests. Recent activity of the running app. kind events: row changes (72 h) and topic messages; requests: runtime requests (every error, about 10% of the rest, kept 24 hours, with trace_id and role); errors: 4xx/5xx only; emails: the env's outbox (sent, sandboxed, deferred, failed) with body text. since: 15m, 2h, 1d or ISO (default the last 24 hours). Never request bodies or tokens. Details: get_guide {section: "tools", topic: "tail"}.

Scope
read
Output
Recent activity of the running app: change events, requests (each with trace_id and role), errors only, or the email outbox (dev and verify mail is kept here, not sent, except to the project's owners and admins). Paths only, never bodies or tokens.

Input schema

NameTypeDescription
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
kindrequired"events" | "requests" | "errors" | "emails"
limitoptionalnumber (≥ 1, ≤ 500)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
sinceoptionalstring
Tool call
{
  "name": "tail",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "kind": "errors",
    "env": "dev",
    "since": "1h"
  }
}
Result (text content)
{
  "kind": "errors",
  "items": [
    {
      "at": "2026-10-28T10:12:03Z",
      "method": "POST",
      "path": "/__appbricx/api/v1/booking",
      "status": 403,
      "error": {
        "code": "TABLE_FORBIDDEN"
      },
      "role": "host",
      "trace_id": "7f3a…"
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:1704

statsread-only

Stats. Numbers about the running app over range (24h default, 7d, 30d). kind requests (count, errors, latency, users), workflows (runs by outcome), database (size, biggest tables, slowest statements) or overview (default). top bounds lists. Needs read.

Scope
read
Output
Numbers over 24 h, 7 d or 30 d: requests (count, errors, p50/p95, active users), workflows (runs by outcome), database (size, biggest tables, slowest statements when available), or an overview of each.

Input schema

NameTypeDescription
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
kindoptional"overview" | "requests" | "workflows" | "database"
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
rangeoptional"24h" | "7d" | "30d"
topoptionalnumber (≥ 1, ≤ 50)
Tool call
{
  "name": "stats",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "kind": "requests",
    "env": "prod",
    "range": "7d"
  }
}
Result (text content)
{
  "kind": "requests",
  "env": "prod",
  "range": "7d",
  "totals": {
    "requests": 18240,
    "errors_5xx": 3,
    "error_rate": 0.0002,
    "p95_ms": 182,
    "active_users": 141
  }
}

Source: internal/svc/agentapi/transport/tools.json:2501

app_userswrites

App users. The app's end users (sign-in accounts). list {q, role, status, limit, cursor}: users with role, persona row and where demo sign-ins work; get {user_id}: plus sessions; invite {email, name?, role} (emails a link); set_role; disable / enable; reset_password; sign_out. Accounts are shared by dev and prod: a change that reaches prod needs deploy and dry_run: false (else 428 with a preview); dev changes apply. Details: get_guide {section: "tools", topic: "app_users"}.

Scope
read to list and get; apply for dev changes; deploy and dry_run: false for changes that reach prod
Output
The app's sign-in accounts: list and search, get (with sessions), invite (emails a link to set a password), set_role, disable, enable, reset_password (emailed), sign_out. Accounts are shared by dev and prod. Links are never answered.
Errors
CONFIRM_REQUIRED (428) with a preview; MAIL_UNAVAILABLE (503).

Input schema

NameTypeDescription
actionrequired"list" | "get" | "invite" | "set_role" | "disable" | "enable" | "reset_password" | "sign_out"
cursoroptionalstringnext_cursor of the previous list (same query) (max 2048)
dry_runoptionalbooleantrue: preview the change, nothing changes; false: confirm a change that reaches prod
emailoptionalstringinvite: who to invite (max 320)
envoptional"dev" | "prod"Database environment: "dev" (the preview, default) or "prod" (the published app)
limitoptionalnumber (≥ 1, ≤ 100)
nameoptionalstringinvite: their name (max 200)
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
qoptionalstringlist: email or name contains (max 200)
roleoptionalstringlist: only this role; invite, set_role: the role (persona id) to give (max 64)
statusoptional"active" | "disabled"
user_idoptionalstringThe user's account id or email (max 320)
Tool call
{
  "name": "app_users",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "invite",
    "email": "priya@acme.example",
    "name": "Priya",
    "role": "hr"
  }
}
Result (text content)
{
  "users": [
    {
      "id": "a81e…",
      "email": "hr@demo.teamday.app",
      "name": "Demo booker",
      "role": "hr",
      "persona_row_id": "…",
      "is_demo": true,
      "disabled": false
    }
  ],
  "total": 4,
  "next_cursor": null
}

Source: internal/svc/agentapi/transport/tools.json:2650

sign_in_providerswrites

Sign-in providers. Read or change social sign-in (Google, GitHub). No provider: lists them. {provider, client: "own", client_id, client_secret} switches on your own OAuth client (callback https://<app host>/__appbricx/auth/oauth/<provider>/callback; kept as project secrets). Google can use the platform's shared test client while testing (platformClientAvailable); your own client wins. enabled: false switches off. signup_policy open|invite sets who may sign up. Changes need apply. Details: get_guide {section: "tools", topic: "sign_in_providers"}.

Scope
read to list; apply to change
Output
Google and GitHub sign-in and whether each is on; your own OAuth client (kept as project secrets), or the platform's shared Google client for testing; signup_policy open or invite. Each provider lists redirectUris, every callback your own client must register (the primary domain first, other domains, the .apps address, the dev site). Once the app is deployed or has a custom domain while Google still uses the shared client, warnings say so (its consent screen shows appbricx): the guide's lifecycle section, topic "Your own Google client", has the steps.

Input schema

NameTypeDescription
clientoptional"platform" | "own"
client_idoptionalstring
client_secretoptionalstring
enabledoptionalboolean
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
provideroptional"google" | "github"
signup_personasoptionalArray<string>With signup_policy open: the personas a sign-up may become (first = default) (at most 10 items)
signup_policyoptional"open" | "invite"open (visitors sign up) or invite (only invited users); rebuilds (apply scope); not with provider
Tool call
{
  "name": "sign_in_providers",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "provider": "google",
    "client": "own",
    "client_id": "1234-abc.apps.googleusercontent.com",
    "client_secret": "GOCSPX-…"
  }
}
Result (text content)
{
  "providers": [
    {
      "provider": "google",
      "enabled": true,
      "client": "own"
    },
    {
      "provider": "github",
      "enabled": false
    }
  ],
  "auth": {
    "signup_policy": "open"
  }
}

Source: internal/svc/agentapi/transport/tools.json:1095

secretswrites

Secrets. The app's secrets (project env vars) code reads with ctx.secrets.get(name). list: names, env, updated-at, never values, plus declared and missing names. set {name, value, env dev|prod|all (default all)}: a run reads the value for the run's env, else all. delete {name}. set and delete need apply and a workspace owner or admin.

Scope
read to list; apply and a workspace owner or admin to set or delete
Output
The project's secrets and config values per environment (dev, prod or all): names, env and updated-at, never values, and which names app.config.ts declares and are missing.

Input schema

NameTypeDescription
actionrequired"list" | "set" | "delete"
envoptional"dev" | "prod" | "all"
nameoptionalstring
project_idrequiredstringProject id (from list_projects or create_project) (uuid)
valueoptionalstring
Tool call
{
  "name": "secrets",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "set",
    "name": "PAYMENTS_URL",
    "value": "https://api.razorpay.com",
    "env": "prod"
  }
}
Result (text content)
{
  "secrets": [
    {
      "name": "PAYMENTS_KEY",
      "env": "prod",
      "secret": true,
      "updatedAt": "2026-10-28T08:00:00Z"
    }
  ],
  "missing": [
    {
      "name": "PAYMENTS_URL",
      "env": "prod"
    }
  ]
}

Source: internal/svc/agentapi/transport/tools.json:1748

integrationswrites

Integrations. Third-party services workflows and actions call (Slack, Twilio, HTTP, webhooks, …). catalog (no project): actions, props and credential fields; list (default): the project's connections, never values; connect {piece, credentials, env, display_name} (apply; deploy for prod or all); disconnect {id}; call {piece, piece_action, input, env, connection}: really sends (prod: deploy + confirm_production). Details: get_guide {section: "tools", topic: "integrations"}.

Scope
any token for catalog; read to list; apply to connect (deploy for prod or all); call really sends (apply on dev, deploy and confirm_production on prod)
Output
Third-party services your workflows call: the catalog (each one's actions, props and credential fields), the project's connections (names, never values), connect, disconnect, and call one action now to test it.
Errors
INTEGRATION_NOT_FOUND (404); "integration not connected" until you connect it.

Input schema

NameTypeDescription
project_idoptionalstringProject id (from list_projects or create_project) (uuid)
actionoptional"list" | "catalog" | "connect" | "disconnect" | "call"list (default), catalog, connect, disconnect or call
pieceoptionalstringThe integration's id from the catalog, e.g. slack, twilio, http (max 100)
envoptional"dev" | "prod" | "all"connect: dev, prod or all (default); call: dev (default) or prod
display_nameoptionalstringconnect: a label for the connection (max 100)
credentialsoptionalobjectconnect: the catalog's auth fields → values (never shown again)
idoptionalstringdisconnect: the connection's id (from list)
piece_actionoptionalstringcall: the action's name from the catalog (default: the integration's default action) (max 100)
connectionoptionalstringcall: a connection id (default: the project's connection for the piece)
inputoptionalobjectcall: the action's props
confirm_productionoptionalbooleancall with env prod: required
Tool call
{
  "name": "integrations",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "action": "call",
    "piece": "slack",
    "piece_action": "send_channel_message",
    "input": {
      "channel": "C0123456",
      "text": "Test from Teamday"
    }
  }
}
Result (text content)
{
  "action": "call",
  "piece": "slack",
  "piece_action": "send_channel_message",
  "env": "dev",
  "ok": true,
  "output": {
    "ok": true,
    "ts": "1730108400.000200"
  }
}

Source: internal/svc/agentapi/transport/tools.json:4744

Many steps in one call

A TypeScript script that calls the other tools.

run_scriptwrites

Run script. Run one TypeScript script that calls the other tools as typed async functions (tools.<name>(input)) and answer only what it returns {ok, result, error?, logs, calls}. code: an async function body (sees tools, args, console) or a default-export module; name runs scripts/<name>.ts. Runs as you; calls that write production, deploy, restore or delete are refused unless allow names their tool; dry_run: true allows only reads and checks. Budgets: timeout_ms (60 s, max 300 s), 200 calls. script_api has the .d.ts. Details: get_guide {section: "tools", topic: "run_script"}.

Scope
read to start; each call inside needs its own scope
Output
Runs one TypeScript script that calls the other tools as async functions (loops, conditions, Promise.all), and answers only what it returns: { ok, result, error?: { message, line, column }, logs, calls, script }. Tools that deploy, roll back, restore, delete or write production are refused unless named in allow; dry_run: true allows only reads, checks and plans. 60 s by default (up to 300 s), 200 calls, 4 at once.
Errors
NOT_ALLOWED (a gated tool not in allow), DRY_RUN, CALL_LIMIT, SCRIPT_NOT_FOUND (name), SCRIPT_RECURSION.

Input schema

NameTypeDescription
allowoptionalArray<string>Tools allowed to write prod, deploy, roll back, restore or delete, e.g. ["deploy"] (at most 50 items)
argsoptionalobjectPassed to the script as args
codeoptionalstringAn async function body, or a module with export default async (tools, args) => {…} (min 1, max 262144)
dry_runoptionalbooleanOnly tools that read, check or plan; anything that would change something is refused
nameoptionalstringInstead of code: run scripts/<name>.ts (the draft, else the latest version) (min 1, max 200)
project_idoptionalstringProject id (from list_projects or create_project) (uuid)
timeout_msoptionalnumberWall-time budget (default 60000) (≥ 1, ≤ 300000)
Tool call
{
  "name": "run_script",
  "arguments": {
    "project_id": "3b7e9a52-6c1d-4f0e-9a8b-2c4d6e8f0a1b",
    "code": "const check = await tools.project_files({ action: \"check\" });\nif (!check.report.ok) return check.report.errors;\nawait tools.project_files({ action: \"apply\" });\nconst read = (as) => tools.call_app({ path: \"/__appbricx/api/v1/booking\", as });\nconst [guest, hr, ops] = await Promise.all([read({ kind: \"visitor\" }), read({ kind: \"user\", role: \"hr\" }), read({ kind: \"user\", role: \"ops\" })]);\nreturn { guest: guest.json?.rowCount, hr: hr.json?.rowCount, ops: ops.json?.rowCount };"
  }
}
Result (text content)
{
  "ok": true,
  "result": {
    "guest": 0,
    "hr": 1,
    "ops": 2
  },
  "calls": [
    {
      "tool": "project_files",
      "ms": 840,
      "ok": true
    },
    {
      "tool": "project_files",
      "ms": 6120,
      "ok": true
    },
    {
      "tool": "call_app",
      "ms": 64,
      "ok": true
    }
  ],
  "script": {
    "id": "sc_…",
    "engine": "v8",
    "ms": 912
  }
}

Source: internal/svc/agentapi/transport/tools.json:3875