Open a draft of a Function
open_draftOpens a draft of a Function, a private copy of its files to change. Nothing in a draft is live, and it never shows in the Function's Versions or its source. It starts from the live Version, or from a Version named by number, and 'read_function_file' reads its files by its 'draft_id'. A draft belongs to whoever opens it and stays until it is discarded. Each owner has a cap of open drafts per Function. Where 'live_from_cli' is true the live Version came from the CLI, and the next CLI deploy replaces whatever the draft changes, and 'warning' says so in a sentence for the person.
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": {
"function_name": "<function_name>",
"name": "<name>"
},
"name": "open_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | A short name for what the draft is for, such as 'pricing page'. It is how the draft is found again. | |
| app_slug | No | The App's slug. Omitted, the Tenant's default App. | |
| function_name | Yes | The Function's slug. | |
| version_number | No | The Version to start from. Omitted, the live one. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| draft | Yes | ||
| warning | Yes | What the next CLI deploy does to this draft's change. Null where the live Version did not come from the CLI. | |
| app_slug | Yes | ||
| function_name | Yes | ||
| live_from_cli | Yes | True where the live Version was deployed with the CLI, which is most likely from a repository. | |
| live_version_number | Yes | The Version that is live. Null where none is. |