create_primary_key
Defines or replaces a table's primary key from column codes, supporting single or composite keys, clearing old membership, and pointing CDM/LDM entities at the new identifier. Supports dry runs.
Instructions
Create (or replace) the primary key of a table from the given column codes. Supports single-column and composite keys, e.g. columns=['order_id','product_id']. Existing PK membership is cleared. In a CDM/LDM this builds the entity's primary identifier (attributes carry no primary flag there) and points the entity at it. Supports dry_run.
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": {
"model_id": "<model_id>",
"table_ref": "<table_ref>",
"columns": "<columns>"
},
"name": "create_primary_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| name | No | ||
| columns | Yes | ||
| dry_run | No | ||
| model_id | Yes | ||
| table_ref | Yes |