# For AI agents Source: https://developers.zite.com/ai-skill How agents get the context they need to build Zite apps well: the framework guide, llms.txt, and tips for great results. Zite is built for AI agents. External agents (Claude, ChatGPT, Cursor) have no training data on `zitejs`, so Zite delivers the context they need, when they need it. ## The framework guide Every `create_sandbox` response includes a **framework guide**: a concise spec of how Zite apps are structured (monorepo layout, data access, `zite.sql()` identifier rules, available imports and libraries, build workflow). Connecting the MCP and booting a sandbox is enough to build correctly, with no memorizing conventions in advance. The same conventions are documented for humans in the [Framework reference](/framework/project-structure). ## llms.txt This site publishes an `llms.txt` index and a full `llms-full.txt` so agents and IDEs can pull the docs into context. Point your tool at: ```text theme={"dark"} https://developers.zite.com/llms-full.txt ``` ## Give your agent Zite context When an agent works **outside** a Zite sandbox, building against the [Database API](/api/overview) or planning in your IDE before it connects, drop this into your project's `AGENTS.md` (or a Cursor rule / `CLAUDE.md`): ```markdown theme={"dark"} # Building on Zite Apps live in a `zitejs` monorepo under `apps//`: React frontend in `src/`, backend workflows in `src/api/` (one file = one workflow). ## Data access (backend only — the frontend never hits the DB directly) - Each `src/api/.ts` default-exports `createEndpoint({ inputSchema, outputSchema, execute })` from `zitejs/backend`. - Query with the generated client: `import { zite } from 'zitejs/db'` — `zite..findAll({ filter })`, plus `findOne/create/update/delete/bulkCreate`. Read `.zite/db.ts` for exact table/field SDK names. - Aggregates & joins: `zite.sql({ query, params })` — double-quote `"Table"`/`"field"` SDK names, bind values via `$1`, SELECT-only, join linked records through the link table. - Frontend calls workflows via the generated typed client: `import { listTickets } from 'zitejs/api'`. - Auth: `useAuth()` from `zitejs/auth` (frontend); `context.user` in workflows when `authenticated: true`. ## Conventions - Imports: platform SDKs via `zitejs/*` (never relative into `.zite/`). Shared UI via `@project/components/ui/*`. Your own files via relative paths. Never edit `.zite/` or `src/main.tsx` (generated). - Available libs: react, tailwindcss, react-router-dom, recharts, lucide-react, framer-motion, zod, date-fns, react-hook-form, @tanstack/react-table, @dnd-kit/*. - After adding/renaming workflows, run `npx zitejs generate` from the workspace root. ``` For the full corpus, point your tool at this site's `llms-full.txt`, and link recipes directly (e.g. `/recipes/stripe-payments`) for task-specific guidance. ## Getting great results * **Be specific about data.** Name the tables and fields; the agent designs the schema from your description. * **Ask it to verify at runtime.** A clean type-check isn't proof. See [the build loop](/mcp/build-loop). * **Let it read `.zite/db.ts`.** It is the source of truth for table and field names. * **Connect integrations first.** Connect Slack or Stripe when the agent hands you a `setup_integration` link, so the token is available while it builds. # Create Database Source: https://developers.zite.com/api/databases/create-database api/openapi.json POST /bases Creates a new database with tables and fields. * Each table requires at least one field * Table names must be unique within your database * Field names must be unique within each table * Field types must match the [Field Types Reference](/api/field-types) # Delete Database Source: https://developers.zite.com/api/databases/delete-database api/openapi.json DELETE /bases/{databaseId} Permanently deletes a database and all its data. Deleting a database will permanently remove the entire database including all tables, fields, views, and records. This action cannot be undone. # Get Database by ID Source: https://developers.zite.com/api/databases/get-database-by-id api/openapi.json GET /bases/{databaseId} Retrieves a specific database by ID with complete table definitions. * Returns complete database structure including table schemas * Includes field configurations and view definitions * Use this endpoint to understand database structure before making changes # Get Databases Source: https://developers.zite.com/api/databases/get-databases api/openapi.json GET /bases Lists all databases for your organization. * Returns all databases accessible to your API key * Use [Get Database by ID](/api/databases/get-database-by-id) to retrieve full table and field structure for a specific database # Zite Database Field Types Source: https://developers.zite.com/api/field-types Complete reference for all available field types and their configurations. The 21 field types you can create through the REST API: their `type` string, value shape, and key settings (defaults in parentheses). Computed and system types (`rich_text`, `rollup`, `created_at`, `updated_at`, `updated_by`, `user`) exist inside Zite apps but are platform-managed and can't be created or configured through this API. | Type | Value | Key settings (defaults) | | ------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | | **Text** `single_line_text` | `string` | — | | **Long Text** `long_text` | `string` (multi-line) | — | | **Email** `email` | `string` (validated) | — | | **URL** `url` | `string` (validated) | — | | **Phone** `phone_number` | `string` (any formatting) | — | | **Number** `number` | `number \| null` | `decimalPlaces` 0–10 (1), `numberFormat` (local) ¹ | | **Currency** `currency` | `number \| null` (raw number) | `currencySymbol` (\$), `decimalPlaces` 0–10 (2), `numberFormat` (local) ¹ | | **Percent** `percent` | `number \| null` (decimal; `0.5` = 50%) | `decimalPlaces` 0+ (0), `numberFormat` (local) ¹, `showProgressBar` (false), `allowNegative` (false) | | **Rating** `rating` | `number \| null` (int 0–maxRating) | `maxRating` 1–10 (5) | | **Duration** `duration` | `number \| null` (total seconds) | `format` (h:mm) ² | | **Single Select** `single_select` | `string \| null` (option label) | `options[]` of `{ label, color? }` ³ | | **Multiple Select** `multiple_select` | `string[]` (labels) | `options[]` of `{ label, color? }` ³ | | **Checkbox** `checkbox` | `boolean` | `color` hex (#a8a4ac) | | **Date** `date` | `string \| null` (ISO date, UTC) | `dateFormat` (local) ⁴ | | **DateTime** `datetime` | `string \| null` (ISO datetime) | `displayTimeZone` (false), `dateFormat` (local) ⁴, `timeFormat` (12h) ⁵, `timezone` (browser) | | **Attachments** `attachments` | `Array<{ url: string, filename?: string }>` | None (URL must be accessible; `filename` is display-only) | | **Linked Record** `linked_record` | `string[]` (record IDs) | `tableId` (required), `allowMultiple` (true), `inverseFieldId?`, `isInverse?` ⁶ | | **Lookup** `lookup` | `any \| any[] \| null` (looked-up values) ⁷ | `linkedRecordFieldId` (required), `lookupFieldId` (required) ⁸ | | **Formula** `formula` | `string \| number \| Date \| boolean \| any[]`, shape follows `resultType` (read-only) | `expression` (required), `resultType` (required), `formatting?`. See [Formula fields](#formula-fields) | | **Autonumber** `autonumber` | `number \| null` (auto-assigned, read-only) | — | | **Source** `source` | JSONB union, system-set (read-only) ⁹ | — | **Notes** 1. `numberFormat`: `local` (default) · `comma_period` · `period_comma` · `space_comma` · `space_period`. 2. Duration `format`: `h:mm` (default) · `h:mm:ss` · `h:mm:ss.s` · `h:mm:ss.ss` · `h:mm:ss.sss`. 3. `options[]`: `label` required; `color` optional (auto-assigned if omitted); `value` optional, so omit when creating, use in writes to reference existing options (reorder, or keep old + add new). Colors: purple, orange, blue, gray, red, yellow, green, pink, lime, tangerine, emerald, sky, teal, indigo, cyan, violet, fuchsia. 4. `dateFormat`: `local` (default) · `long` · `us` · `european` · `iso`. 5. `timeFormat`: `12h` (default) · `24h`. 6. `tableId` accepts a table ID or name during base creation; creating the field auto-connects both tables in both directions. 7. Single value if the linked-record field has `allowMultiple: false`, array if `true`; element type matches the looked-up field. 8. Cannot be created during initial base setup. Add it later via the field-creation endpoint. 9. `{ type: "public_api", apiKeyId? }` | `{ type: "form_submission", flowPublicId, sessionId }` | `{ type: "workflow", workflowId, executionId }` | `{ type: "manual", reason?, userId? }` | `null`. ## Formula fields Formula fields compute their value from other fields using a formula expression. They are read-only and automatically recalculate when referenced fields change. See the [Formulas guide](https://zite.com/help/database/configure-database/formulas) for the complete list of supported functions. ```json theme={"dark"} { "name": "Total Price", "type": "formula", "template": { "expression": "SUM({Price}, {Tax})", "resultType": "number", "formatting": { "numberDisplayType": "currency", "decimalPlaces": 2 } } } ``` | Property | Type | Description | | ------------ | ------ | -------------------------------------------------------------------------- | | `expression` | string | The formula expression, e.g. `"SUM({Price}, {Tax})"` | | `resultType` | string | The output type: `"text"`, `"number"`, `"date"`, `"boolean"`, or `"array"` | | `formatting` | object | Optional display formatting (see below) | **Formatting options** * Numbers use `numberDisplayType`: `"number"` (plain) · `"currency"` (use with `decimalPlaces`, `numberFormat`) · `"percent"` · `"duration"`. * Dates use `dateFormat`, `timeFormat` (`"12h"` or `"24h"`), `timezone`, `displayTimeZone` (whether to show the timezone). ## Primary field The first field in each table is the **primary field** and must be one of: `single_line_text`, `long_text`, `date`, `phone_number`, `email`, `url`, `number`, `currency`, `percent`, `duration`, `autonumber`, `formula`. ## Empty values | Value kind | Empty value | | ---------- | ----------- | | Text | `""` | | Number | `null` | | Boolean | `false` | | Array | `[]` | | Object | `null` | Changing a field's type after data exists can cause data loss if the new type is incompatible with existing values. # Create Field Source: https://developers.zite.com/api/fields/create-field api/openapi.json POST /bases/{databaseId}/tables/{tableId}/fields Adds a new field to an existing table using either table ID or table name. Both `type` and `name` are required. The `template` object structure varies by field type - see [Field Types Reference](/api/field-types) for complete details ## Example Field Creation Here's how to create a single select field: ```json theme={"dark"} { "type": "single_select", "name": "Status", "template": { "options": [ {"label": "Active", "color": "#10b981"}, {"label": "Inactive", "color": "#6b7280"}, {"label": "Pending", "color": "#f59e0b"}, {"label": "Archived", "color": "#ef4444"} ] } } ``` # Delete Field Source: https://developers.zite.com/api/fields/delete-field api/openapi.json DELETE /bases/{databaseId}/tables/{tableId}/fields/{fieldId} Permanently removes a field from a table. Deleting a field will permanently remove all data stored in that field across all records. This action cannot be undone. # List Fields Source: https://developers.zite.com/api/fields/list-fields api/openapi.json GET /bases/{databaseId}/tables/{tableId}/fields Retrieve all fields for a table using either table ID or table name. Fields are returned in display order. Each field includes its `id`, `name`, `type`, `order`, and a `template` object with field-specific configuration. See the [Field Types Reference](/api/field-types) for the template structure of each field type. # Update Field Source: https://developers.zite.com/api/fields/update-field api/openapi.json PATCH /bases/{databaseId}/tables/{tableId}/fields/{fieldId} Updates field properties and configuration using either field ID or field name. The `template` object structure varies by field type - see [Field Types Reference](/api/field-types) for complete details # Overview Source: https://developers.zite.com/api/mcp/overview Connect an AI tool to Zite via MCP to read, write, and query your data in natural language. The Zite MCP is a single server at `https://mcp.zite.com/mcp`, reachable over the [Model Context Protocol](https://modelcontextprotocol.io). It exposes a **Data** tool group (below) plus a **Build** tool group for [building apps](/mcp/overview).