akb_create_table
Create a structured data table in a vault by defining columns, types, indexes, and unique keys. Optionally place it in a collection to appear beside related documents, or leave it at the vault root.
Instructions
Create a structured data table in a vault. The response carries the canonical uri — akb://{vault}/coll/{collection}/table/{name} when stored under a collection, or akb://{vault}/table/{name} at the vault root. Tables live alongside documents inside collections and follow the same permissions. Define columns with name and type (text, number, boolean, date, json). Optional collection (e.g. 'sessions/learnings') groups the table under that collection so it appears beside the documents and files there in akb_browse; omit for vault root.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Table name (unique within the vault) | |
| vault | No | Target vault name. Required unless `parent` is given. | |
| parent | No | Parent location as a canonical URI — `akb://{vault}` for the vault root, `akb://{vault}/coll/{path}` for a collection. When given, the table is created there and `vault`/`collection` are derived from the URI. | |
| columns | Yes | Column definitions | |
| indexes | No | Declarative lookup (btree) indexes. Each item is {name?, columns}. A column is a bare string or {name, order} where order is 'asc' (default) or 'desc'. Unique indexes are expressed via `unique_keys`, not here. | |
| collection | No | Collection path (e.g. 'specs' or 'sessions/learnings'). Omit for vault root. Ignored when `parent` is given. | |
| description | No | ||
| unique_keys | No | Declarative UNIQUE keys. Each item is {name?, columns}. `columns` is a list of existing column names (single or composite). `name` is optional — when omitted AKB generates a deterministic, stable name. Use this (not `indexes`) for unique indexes. | |
| if_not_exists | No | When true, an existing table is NOT an error: returns created=false instead of a 409 conflict. Nothing is altered either way. If you also hold READ access to the vault the response carries the STORED schema plus matches_request and mismatches[], so divergence from your spec is explicit; a write-only credential gets only {kind, name, created, outcome}. Must be a real boolean — the string "true" is rejected. Default false keeps the 409. | |
| _vault_skill_ack | No | Opaque acknowledgement returned as vault_skill.ack_token. After applying that guide, retry the unchanged operation with this value. The bundled proxy supplies it automatically. |