Skip to content
View raw ↗

Entities

Entities are your app's data models — the things it tracks. Define one and Foundation gives you a database table with full create/read/update/delete, queries, and an API. No schema work, no DevOps.

Configure

Define an entity

An entity has a name and fields. Set it up in the dashboard, the wizard, or by telling your agent:

"Add an entity called Projects with fields: name (text), status (text), due date (date)."

Foundation creates the table, generates CRUD, and optionally exposes it over your API or MCP.

What each entity gives you

  • Create, read, update, delete
  • Query, filter, and paginate
  • Access control via roles & scopes

Choose how it's exposed

SurfaceWho uses it
REST APIYour own app
API as a ServiceYour users, programmatically
MCPAI agents

Toggle these per entity.

Use in your app

Your frontend reads and writes entities through the SDK — typed, with filtering and pagination.

Tell your agent: "List the current user's projects, newest first, and let them add a new one."

Show the code
ts
// list with filters + pagination
const { items, nextCursor } = await foundation.db.list('projects', {
  orderBy: 'createdAt',
  orderDir: 'desc',
  limit: 50,
})

// create / update / delete
const project = await foundation.db.create('projects', { name, status: 'active' })
await foundation.db.update('projects', project.id, { status: 'done' })
await foundation.db.delete('projects', project.id)

Reference