Create a project
create_projectCreate a project in the studio from a model, and optionally its metrics file.
`model_text` is YAML in the model spec or DBML. From a plain-English
description of a business, DBML is the quick way. Write it straight away,
but run the checklist first: every foreign key `not_null` unless the
relationship is really optional; every text column given a generator
type or an enum (the fallback report in `check_model` must be empty);
categories as enums, with `weights` where not uniform; `when` for
columns that only apply in some states; `after` for dates that follow
another date; `min`/`max` and a `distribution` on numbers; `run.locale`
matching the country. This checks the model and says what to fix:
Table customers {
id int [pk]
name varchar
email varchar
created_at timestamp
}
Table orders {
id int [pk]
customer_id int [not null, ref: > customers.id]
status varchar [note: '{"weights": {"paid": 70, "refunded": 5, "shipped": 25}}']
total decimal(10,2) [note: '{"min": 5, "max": 400}']
ordered_at timestamp
}
Pasted DDL or a dbt schema.yml: rewrite it as DBML like this.
`get_model_guide` has the hints that shape values (the JSON notes).
Both are checked first; a file with errors creates nothing, and the
errors come back instead. DBML is saved as the model document it
converts to. A `run` block in the model sets the project's seed, rows a
table, rows per table, as-of day and locale (the reply says which it
took); what it leaves out starts at 100 rows a table, seed 42, dates
anchored on today. Returns the new project's id (for every other tool)
and its studio URL. Next: `get_metrics_guide`, `check_metrics`,
`save_metrics`. Needs a key with save access that is not limited to one
project; the plan's project limit applies.
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>",
"model_text": "<model_text>"
},
"name": "create_project"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| model_text | Yes | ||
| metrics_text | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |