table_index
Create indexes and unique keys on a data table (a unique key makes INSERT ... ON CONFLICT work). One call is one atomic step.
Operations:
{"op":"create_index","columns":["bank_id"]} — optional name, unique, method (btree default) and where for a partial index, e.g. "where":"status = 'suggested'". Without a name the server derives one from table and columns, so a repeat does not duplicate it (applied: [], note already_exists).
{"op":"add_unique","columns":["side","line_id"]} — refused with DUPLICATE_VALUES and a sample of the duplicates when the data is not unique.
{"op":"drop_index","name":"..."} — DESTRUCTIVE
{"op":"drop_constraint","name":"..."} — DESTRUCTIVE
Destructive operations need a person: the call returns APPROVAL_REQUIRED with approval.requestId and a card in the chat that lists the workflows using this table. Do not retry; the person's decision starts your next turn. Failures return success:false, code, operationIndex and the database message unchanged.
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": {
"operations": "<operations>"
},
"name": "table_index"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tableId | No | Table ID. Supply exactly one of tableId or tableName. | |
| tableName | No | Exact, case-sensitive accessible table name or SQL table slug; preferred when known. table, name and table_name are accepted aliases. Supply exactly one of tableName or tableId. | |
| operations | Yes | Array of operations (a JSON string is also accepted). Example: [{"op":"add_unique","columns":["match_id"]}] | |
| approvalRequestId | No | Optional. The requestId of an earlier APPROVAL_REQUIRED result, to read its outcome. It never approves anything: only a person can, on the card in the chat. |