Skip to main content
Glama

Create a database table

create_table
Destructive

Makes a new table in the site's connected Supabase project, the same way as Add table in Xodia's Database view (Content, Database): the fields you list plus id and created_at, row rules always on with one of eight rules (see rule) for who can see and change entries, and a migration file in supabase/migrations/ on the branch so the change shows in Site code and git. Changes the user's live database at once, outside Xodia's Versions: say what you are adding before you call it. Pick the rule from what the owner asked; when it is unclear, ask, and use "owner_only" until they say. For what visitors read and only the owner fills (a menu, a price list, opening hours, a team list), use "everyone_reads_owner_writes": no form on the site can add to it, and the owner adds and changes its entries in Xodia's Database view (Content, Database) (no tool adds entries). For entries the owner keeps for one signed-in person each (a client's project and its milestones), use "own_rows_read_owner_writes" with fullAccessRole "owner": each person sees only the entries whose created_by is them and nobody changes them from the site. Refused when a table or field name is taken (pick another), for kinds Xodia doesn't add, and when the site has no database connected. With source "xodia" (or when get_project database.source is "xodia") it works on the site's own Xodia database, whose tables and rules are the file xodia/data-rules.json in the repo: it adds the table to that file with the indexes the site's data blocks already list along (checked; problems come back as invalid_input, each at its path with the place in your table), saves it on the branch and sends it to the test data the preview uses; the live site gets it when the owner goes live. Pass indexes for lists you are about to write. Needs the site's Xodia database turned on (data_not_on otherwise: the owner turns it on in Xodia's Database view (Content, Database)) and a workspace owner or admin. No tool deletes or renames a table or field, deletes entries, or runs SQL: the owner does that in Xodia's Database view (Content, Database).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "rule": "<rule>",
      "projectId": "<projectId>"
    },
    "name": "create_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesThe table's name: letters, numbers, spaces and underscores, starting with a letter (it is stored lower case with underscores: "Guest count" becomes guest_count)
ruleYesWho can see and change entries: "everyone_reads_signed_in_adds" (Everyone sees, signed-in people add: Anyone can see entries. People who are signed in can add new ones and change their own.); "everyone_reads_owner_writes" (Everyone sees, only you change: Anyone can see entries. Nobody can add or change them from the site. You add and change them in Xodia.); "own_rows_only" (Each person sees only their own: Signed-in people see and change only the entries they added.); "own_rows_read_owner_writes" (Each person sees their own, only the owner changes: Signed-in people see only the entries kept for them. Nobody adds or changes them from the site. You add and change them in Xodia.); "signed_in_reads_own_writes" (Signed-in people see everyone's, each changes only their own: People who are signed in see every entry. Each of them adds and changes only their own.); "signed_in_only" (Signed-in people only: Only people who are signed in can see, add and change entries.); "owner_only" (Only you: Visitors can't see or change entries. You manage them in Xodia.); "visitors_add_owner_reads" (Visitors can add, only the owner sees all: Anyone can add an entry, signed in or not, like an order or a booking. Signed-in people see only their own. Nobody changes them from the site. You see and manage all of them in Xodia.)
branchNoOptional branch for the migration file; default the branch the workspace has open
fieldsNoThe table's own fields. Every table also gets id and created_at (and created_by for the rules that track who added an entry): don't list those
sourceNoWhich database: "xodia" (the site's own Xodia database, kept by Xodia) or "supabase" (the Supabase project the owner connected). Leave out to use the one get_project database.source names
indexesNoXodia database only: the indexes the site's lists need, each a list of 1 to 3 field names in order: the equal-to filters first, then the sort or compared field (filter="status:eq:open" sort="starts_at" needs ["status", "starts_at"]). Lists and counts only filter and sort along an index; created_at, and created_by with created_at for own-entry rules, are always there
projectIdYesProject id from list_projects
fullAccessRoleNoOptional, beside any rule: people with a role can see and change everything (a role name such as "owner" or "staff", read from the person's app metadata like the data kit's HasRole). Only when the user asks for it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / rule / description
      Previous value: -"Who can see and change entries: \"everyone_reads_signed_in_adds\" (Everyone sees, signed-in people add: Anyone can see entries. People who are signed in can add new ones and change their own.); \"everyone_reads_owner_writes\" (Everyone sees, only you change: Anyone can see entries. Nobody can add or change them from the site. You add and change them in Xodia.); \"own_rows_only\" (Each person sees only their own: Signed-in people see and change only the entries they added.); \"own_rows_read_owner_writes\" (Each person sees their own, only the owner changes: Signed-in people see only the entries kept for them. Nobody adds or changes them from the site. You add and change them in Xodia.); \"signed_in_reads_own_writes\" (Signed-in people see everyone's, each changes only their own: People who are signed in see every entry. Each of them adds and changes only their own.); \"signed_in_only\" (Signed-in people only: Only people who are signed in can see, add and change entries.); \"owner_only\" (Only you: Visitors can't see or change entries. You manage them in Xodia.)"New value: +"Who can see and change entries: \"everyone_reads_signed_in_adds\" (Everyone sees, signed-in people add: Anyone can see entries. People who are signed in can add new ones and change their own.); \"everyone_reads_owner_writes\" (Everyone sees, only you change: Anyone can see entries. Nobody can add or change them from the site. You add and change them in Xodia.); \"own_rows_only\" (Each person sees only their own: Signed-in people see and change only the entries they added.); \"own_rows_read_owner_writes\" (Each person sees their own, only the owner changes: Signed-in people see only the entries kept for them. Nobody adds or changes them from the site. You add and change them in Xodia.); \"signed_in_reads_own_writes\" (Signed-in people see everyone's, each changes only their own: People who are signed in see every entry. Each of them adds and changes only their own.); \"signed_in_only\" (Signed-in people only: Only people who are signed in can see, add and change entries.); \"owner_only\" (Only you: Visitors can't see or change entries. You manage them in Xodia.); \"visitors_add_owner_reads\" (Visitors can add, only the owner sees all: Anyone can add an entry, signed in or not, like an order or a booking. Signed-in people see only their own. Nobody changes them from the site. You see and manage all of them in Xodia.)"
    • changedInput schema / properties / rule / enum
      Previous value: -[
      -  "everyone_reads_signed_in_adds",
      -  "everyone_reads_owner_writes",
      -  "own_rows_only",
      -  "own_rows_read_owner_writes",
      -  "signed_in_reads_own_writes",
      -  "signed_in_only",
      -  "owner_only"
      -]New value: +[
      +  "everyone_reads_signed_in_adds",
      +  "everyone_reads_owner_writes",
      +  "own_rows_only",
      +  "own_rows_read_owner_writes",
      +  "signed_in_reads_own_writes",
      +  "signed_in_only",
      +  "owner_only",
      +  "visitors_add_owner_reads"
      +]
  2. Changed2 schema fields changed
    • addedInput schema / properties / indexes
      Added value: +{
      +  "description": "Xodia database only: the indexes the site's lists need, each a list of 1 to 3 field names in order: the equal-to filters first, then the sort or compared field (filter=\"status:eq:open\" sort=\"starts_at\" needs [\"status\", \"starts_at\"]). Lists and counts only filter and sort along an index; created_at, and created_by with created_at for own-entry rules, are always there",
      +  "items": {
      +    "items": {
      +      "maxLength": 63,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "maxItems": 3,
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  "maxItems": 8,
      +  "type": "array"
      +}
    • addedInput schema / properties / source
      Added value: +{
      +  "description": "Which database: \"xodia\" (the site's own Xodia database, kept by Xodia) or \"supabase\" (the Supabase project the owner connected). Leave out to use the one get_project database.source names",
      +  "enum": [
      +    "xodia",
      +    "supabase"
      +  ],
      +  "type": "string"
      +}
  3. Added

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With destructiveHint=true already declared, the description still adds substantial context: the live database changes at once outside Xodia's Versions, a migration file is written to supabase/migrations/, execution requires a workspace owner or admin, and refusals are enumerated (taken names, unsupported kinds, no database connected, data_not_on). The xodia-source branch behavior (xodia/data-rules.json, preview test data, live on go-live) is unusually specific. It stops short of describing what the call returns, which keeps it off a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded, but the remainder is one very long paragraph that interleaves use-case routing, refusal conditions, and xodia-specific mechanics with no separate sentences or headings. Nearly every sentence carries information, yet the density makes it hard to scan for the one piece an agent needs at call time.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter destructive tool with no output schema, it covers permissions, error codes, live-versus-preview propagation, and the two source backends. The main omission is the return value or success signal, which no output schema supplies either.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by adding decision logic the enums don't carry, such as which rule fits a menu versus a client project, and by instructing "Pass indexes for lists you are about to write." Its index explanation largely restates the schema's own index description, so it is not a full 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first clause gives a specific verb and resource ("Makes a new table in the site's connected Supabase project") and anchors it to a known surface ("the same way as Add table in Xodia's Database view"). It also states what is auto-added (id, created_at, row rules, migration file), separating it from add_field or create_collection without needing the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly routes rule selection by use case: "everyone_reads_owner_writes" for menus, price lists, opening hours, team lists; "own_rows_read_owner_writes" with fullAccessRole "owner" for per-client rows. It also gives a fallback policy ("when it is unclear, ask, and use owner_only until they say") and names what no tool can do, pointing to the Database view instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources