clone_app
ChatGPTCreates a full copy of an existing app (data model, GUI config, and all source files). The clone is owned by the current user and is independent of the original. Use this to experiment with changes without affecting the original app. Set deploy=true to make the clone live immediately.
create_app
ChatGPTCreates a new project from one HTML page and publishes it. This is the ONLY way to start a project, whatever it will become: a landing page, a portfolio, a game, a tool, a dashboard, or a full app with a database and logins. A website and an app are the same thing here. GUI FIRST: pass a complete, polished page as indexHtml, written in plain HTML + CSS + vanilla JavaScript, so the user sees a real result at once. There is NO data model at creation. Until one exists, make the page work with state kept in the browser (in memory or localStorage); do not show made-up records as if they were real. When the user asks to store data, add entities to the SAME project with update_app and connect the page to them: get_docs("website") explains how a page reads and writes data and handles login. If the very first request already needs saved, shared or per-user data, still create the page first, then do that right after, in the same turn. Do NOT build a React app (src/frontend/) unless the user explicitly asks for React: prefer vanilla HTML + JS under website/. CREATE ONCE, MODIFY THEREAFTER: call this ONLY for a project that does not exist yet. To change, restyle, fix or extend a project that already exists (including one created earlier in this conversation), do NOT call create_app again for that project: keep its projectId, read the page with read_files, change it with patch_files or write_files, then call deploy_app, so the same project and the same URL get the new revision. Create a second project only when the user explicitly asks for a new, separate one or a copy (clone_app copies one). The page you pass as indexHtml is saved as website/index.html, and the website/ folder is the ONE served root: website/styles.css is served next to the page and website/css/site.css sits in a subfolder. Always reference them with RELATIVE paths ("styles.css", "css/site.css"); a leading slash ("/styles.css") does not resolve. Add more files afterwards with write_files under website/ (text files only: .html, .css, .js, .json, .md, .txt). Images and fonts cannot be uploaded through write_files, so use inline SVG, data URIs or external URLs. Do not write under website/compiled/, it is generated on every deploy. Publishes by default; pass deploy=false to keep it unpublished. Returns two URLs: an editor URL (the project opened in the web IDE) and a deployed URL (the live project). Both URLs should be presented to the user.
create_blank_app
ChatGPTCreates a STARTER project from a name alone, in the authenticated user's personal organization: one page with a sign-in form and instructions for building the app, published at once. It has no data model. This serves the Apps view's "new app" action. To BUILD something for the user (a website, a tool, an app) use create_app instead, which publishes a real page; do not use this tool for that. The name is 1 to 60 characters. Returns the new project's id, live URL, git remote and editor URL.
create_record
ChatGPTCreates one record in a collection of a deployed app, as the current user. Returns the ID of the new record.
delete_app
ChatGPTPERMANENTLY deletes a project (apps and websites are the same thing). This cannot be undone. It removes the project itself, its source files and history, its stored data, its published site, its custom domains and the access other people were given to it. The authenticated user must be an admin of the project. Use it ONLY when the user explicitly asked to delete this specific project, and confirm the project by name first. To remove a single file use delete_file; to remove a record use delete_record.
delete_file
ChatGPTPermanently deletes a file from a project. Only files in website/, src/backend/ or src/frontend/ can be deleted. Files in src/generated/ are auto-generated and cannot be deleted. Returns error if file does not exist. This action cannot be undone.
delete_record
ChatGPTDeletes one record of a collection of a deployed app, as the current user. Returns the ID of the record.
deploy_app
ChatGPTDeploys the current version of an app (data model + custom code) to production. Use this after making code changes with write_files or patch_files, without needing to call update_app. The app will be live at its deployed URL after deployment.
diff_files
ChatGPTCompares source files vs. deployed files for an app. Shows which files were added, removed, or modified since last deploy. Set includeDiffs=true to see line-level diffs for modified files. Use this to decide whether to deploy or investigate changes.
get_app_status
ChatGPTReturns the status of an app: its metadata (name, about, kind, org, dates, remixable, restricted, custom roles), the deployed commit, whether the source changed since that deploy and which paths, the site files served, the compiled backend modules and the source file paths.
get_app_summary
ChatGPTReturns a summary of one project: its name, its live URL and whether anything is published there, whether it is restricted, its git remote and editor URL, its branches and tags, and how many source files and bytes it holds. Read-only, and it reads no file contents. published is false until the project is deployed (use deploy_app), even when it has source files. initialized is false for a project whose git repository has no commit yet. For the list of files use list_files; for recent changes use git_log; for errors and runtime state use get_app_status.
get_data_model
ChatGPTReturns the data model of a deployed app: its entities with their fields, the number of records per collection, and the SQL tables.
get_docs
ChatGPTGet additional platform documentation. Available topics: readme (platform overview, structure, and the cross-cutting rules), website (START HERE for any GUI work: the hand-written page in plain HTML + JS under website/, how it reads and writes data and handles login through @craftian/sdk, and adding a data model to an existing page), frontend (ONLY when the user explicitly asks for React: building custom React UI, the @built-in/ui component catalog, patterns, games, and TypeScript types), backend (custom server-side logic: routes, hooks, scheduler, auth, mail, and the complete db API reference). Read "website" before building or changing the page users see (plain HTML + JS, the default), "backend" for server logic + the complete db API reference, "readme" for a platform overview, and "frontend" only when the user explicitly asks for a React app.
get_record
ChatGPTReturns one record of a collection of a deployed app, by ID, as the current user.
git_log
ChatGPTReturns a project's git commit log, newest first. Each commit carries its oid, message, author (name and email), timestamp (ms since epoch), parents, and the NAMES of the files it changed, each with a status. File names only: no file contents and no diffs are returned (use read_files for the current content of a file). Statuses: added (the file did not exist before the commit), modified (it existed and its content changed), deleted (the commit removed it). A commit's file list is relative to its first parent, so the first commit of a project lists every file as added and a merge commit shows only what differs from its first parent. limit sets how many commits to return (default 20, maximum 100); truncated is true when older commits exist beyond the returned window. A commit's file list is capped at 200 entries, and filesTruncated is true on a commit whose list was capped. A project with no commits yet returns an empty list. Use this to see what changed recently before modifying a project.
list_apps
ChatGPTLists all projects (apps and websites are the same thing) owned by the authenticated user. Returns each one's name, id and editor URL (the project opened in the web IDE). Use this to find an existing project before changing it, instead of creating a new one. Use the returned app IDs with other tools (update_app, list_files, write_files, etc.) to manage specific apps.
list_files
ChatGPTLists all files in a project, organized by category: backend (custom server logic), frontend (React UI, only in projects that use React), generated (auto-generated files, read-only), website (the hand-written page and its assets, served as-is; the default place for GUI work), compiled (website/compiled/ — generated from src/frontend/ on every deploy, read-only, writes are refused), and other (top-level configs, anything outside src/). Use this to see what files exist before creating or modifying them.
list_records
ChatGPTLists the records of one collection of a deployed app, as the current user. Returns the records and the total count.
open_apps
ChatGPTOpens the Apps view: the projects (apps and websites are the same thing) the authenticated user can reach, shown as a page inside the host. Takes no arguments. Returns who the user is and each project's id, name, kind, description, organization, and created and updated times (ms since epoch). Use this when the user asks to see or manage their apps in a view. To only find a project before changing it, use list_apps.
patch_files
ChatGPTApplies targeted text replacements to one or more existing files (the page under website/, or code under src/). This is the normal way to change an existing page. Each patch specifies an exact old_string to find and a new_string to replace it with. The old_string must appear exactly once in the file (for safety). Use read_files first to see current content. For full file rewrites, use write_files instead.
read_files
ChatGPTReads the contents of one or more files from a project. Can read the page and its assets (website/), custom code (src/backend/, src/frontend/) and auto-generated files (src/generated/, read-only). Use this to inspect existing code before making changes with write_files or patch_files.
search_files
ChatGPTSearches across all source files in an app for a text pattern. Returns matching lines with file paths and line numbers. Useful for finding where a function, component, or variable is defined or used. Supports regex patterns. Optionally filter by file path prefix (e.g. "src/frontend/").
show_scope
ChatGPTShows the user the scope of a NEW website or app before it is built, as a view in the conversation where they mark each proposed feature "in now", "later" or "never" and answer open questions, then press "Build with this scope", which sends the agreed scope back to you as their message. Call this FIRST when the user asks for a new website or app and has not agreed a scope yet, instead of guessing; then wait for their reply and build exactly that with create_app. Skip it when the user says to just build it, or for a small change to an existing project. Pass a short title, a one-sentence summary of what you understood, 3 to 25 features (each a short label, an optional one-line detail, and your suggestion), and up to 5 questions only the user can answer. Write for a non-technical reader. It stores nothing and builds nothing.
update_app
ChatGPTUpdates an existing app. All updates are partial (merge-style) — only specify what you want to change. You do NOT need to resend the full model. Only include new or modified entities, and within each entity, only new or modified fields. Only the properties you specify will be updated; omitted properties remain unchanged. To remove entities, use deleteEntities with an array of entity names. To add or modify entities, include them in project.entities — existing entities matched by name are updated, new names create new entities. Fields within entities follow the same partial logic: include only what is new or changed. Set deploy=true to redeploy after updating. Requires app ownership. This is the ONLY way to add or change the data model: a project is created with no entities, and they are added here when the user needs to store data. Note: this only updates the data model (tables and their API). It does NOT change the page users see: a hand-written website/index.html stays as it is, so after adding entities connect the page to them with the file tools (read get_docs("website") first), then deploy. Data is private by default (signed-out visitors are refused, signed-in users see their own records), so the page then needs a sign-in step, or allowAnonymousCRUD on an entity that is meant to be public. Do not rebuild the GUI in React for this unless the user explicitly asks for React.
update_record
ChatGPTChanges the given field values of one record of a deployed app, as the current user. Returns the ID of the record.
write_files
ChatGPTCreates or updates one or more files in a project. If a file exists it is overwritten; if it does not exist it is created. The change is saved to the project source and its git history. It goes live on deploy_app. Page files (website/): the hand-written GUI in plain HTML, CSS and JavaScript, served as-is. This is the DEFAULT place for GUI work. Backend files (src/backend/): TypeScript (.ts) for custom routes, hooks and scheduled tasks. Frontend files (src/frontend/): React components (.tsx). Write here ONLY when the user explicitly asked for a React app. Read get_docs("website") before page work that touches data or login, get_docs("backend") before backend code, and get_docs("frontend") before React code. Allowed extensions: .ts, .tsx, .json, .css, .scss, .html, .md, .txt, plus .js under website/ only.