File programs: edit, generate
The File Verbs edit, generate as MCP do programs, with inputs, result, refusals and an example.
Reference for File, one group of File programs.
File.edit
Edit makes a new File from an existing one by instruction, such as upscaling or animating a still, and leaves the source unchanged. Verb page.
do: return await $.File.edit(input)Emits File.edited.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
file | File | required | The source File. |
instruction | text | required | What to change. |
references | list of File | Further Files the edit follows. | |
format | json | Aspect ratio, resolution, duration and file type of the result. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
file | File | required | The new File, which records its source. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.File.edit({ file: 'file_V1AuhyCTsH', instruction: 'Example instruction' })"
}
}File.generate
Generate makes an image, video, speech or music File from a prompt and reference Files, and records how it was made. Verb page.
do: return await $.File.generate(input)Emits File.generated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
kind | string | required | What to make. |
prompt | text | required | What to make, or for speech the text to speak. |
references | list of File | Files the output follows, such as a product photo or a first frame. | |
voice | Voice | The Voice that speaks, for speech. | |
format | json | Aspect ratio, resolution, duration and file type. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
file | File | required | The generated File, its bytes in Storage and its provenance recorded. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.File.generate({ kind: 'image', prompt: 'Example prompt' })"
}
}