Skip to Content
Docs
ReferenceOrganise

import_file

Import a file

Adds a file to a project the user can edit, as an upload in awen does: from a public URL, from a file the user attached in ChatGPT (file), from text with a name, or from a file you sent after create_upload (upload_id). Drive takes files up to 512 MB, images up to 95 MB and any video, never programs. Only an MP4 opens as a video in awen: other formats save as plain files. Pass exactly one of url, file, text or upload_id. A file you made on this machine from awen files, such as a cutout, names them in derived_from. A memory's instructions are its own Memory.md, so no file named Memory.md can be added to a memory; the user edits them in awen.

Arguments

ArgumentTypeRequiredWhat it is
project_idstringYesThe project's project_id.
folder_id"root" | stringNo"root" (the default), or the entry_id of the folder to put the file in.
urlstringNoA public http(s) URL of the file itself, such as an image's own address. A web page is refused: open it and pass the URL of the image or file it shows.
textstringNoText to save as a file (UTF-8, up to 1 MiB); its name's extension sets its type.
upload_idstringNoThe upload_id create_upload returned, once its command has sent the file.
namestringNoThe file's name. A name already taken in the folder gets a number, and the answer gives the final one. Required with text; otherwise the URL's or the attachment's name. An upload keeps the name given to create_upload.
derived_fromarray of stringNoUp to 20 awen files this file was made from, such as the image you cut out or retouched on this machine: ids from a list, search or get_turn. awen records them as the file's lineage, as for a file made in awen.
client_request_idstringNoNames this request, for you and this organisation. The same name with the same arguments answers the first result and starts or saves nothing again; the same name with other arguments is another request. 1 to 128 letters, digits, `.`, `_`, `:` or `-`.
fileobjectNoA file the user attached in ChatGPT, which sends it in place of url, text or upload_id.

Call

A host sends a tools/call request to the MCP endpoint, with the arguments it needs.

{  "jsonrpc": "2.0",  "id": 1,  "method": "tools/call",  "params": {    "name": "import_file",    "arguments": {      "project_id": "<string>"    }  }}

Arguments schema

{  "type": "object",  "properties": {    "project_id": {      "type": "string",      "minLength": 1,      "maxLength": 128,      "pattern": "^[A-Za-z0-9_-]+$",      "description": "The project's project_id."    },    "folder_id": {      "description": "\"root\" (the default), or the entry_id of the folder to put the file in.",      "anyOf": [        {          "type": "string",          "const": "root"        },        {          "type": "string",          "minLength": 1,          "maxLength": 128,          "pattern": "^[A-Za-z0-9_-]+$"        }      ]    },    "url": {      "description": "A public http(s) URL of the file itself, such as an image's own address. A web page is refused: open it and pass the URL of the image or file it shows.",      "type": "string",      "maxLength": 4096    },    "text": {      "description": "Text to save as a file (UTF-8, up to 1 MiB); its name's extension sets its type.",      "type": "string",      "maxLength": 1048576    },    "upload_id": {      "description": "The upload_id create_upload returned, once its command has sent the file.",      "type": "string",      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"    },    "name": {      "description": "The file's name. A name already taken in the folder gets a number, and the answer gives the final one. Required with text; otherwise the URL's or the attachment's name. An upload keeps the name given to create_upload.",      "type": "string",      "minLength": 1,      "maxLength": 2083,      "pattern": "^[^\\x00]*$"    },    "derived_from": {      "description": "Up to 20 awen files this file was made from, such as the image you cut out or retouched on this machine: ids from a list, search or get_turn. awen records them as the file's lineage, as for a file made in awen.",      "minItems": 1,      "maxItems": 20,      "type": "array",      "items": {        "type": "string",        "minLength": 1,        "maxLength": 144      }    },    "client_request_id": {      "type": "string",      "minLength": 1,      "maxLength": 128,      "pattern": "^[A-Za-z0-9._:-]+$",      "description": "Names this request, for you and this organisation. The same name with the same arguments answers the first result and starts or saves nothing again; the same name with other arguments is another request. 1 to 128 letters, digits, `.`, `_`, `:` or `-`."    },    "file": {      "type": "object",      "description": "A file the user attached in ChatGPT, which sends it in place of url, text or upload_id."    }  },  "required": [    "project_id"  ]}

Answer

The answer's structuredContent follows this schema, and its text holds the same JSON.

{  "type": "object",  "properties": {    "id": {      "type": "string"    },    "entry_id": {      "type": "string"    },    "media_id": {      "type": "string"    },    "revision_id": {      "type": [        "string",        "null"      ]    },    "kind": {      "type": "string",      "enum": [        "folder",        "image",        "video",        "canvas",        "three_d",        "whiteboard",        "file"      ]    },    "folder_id": {      "type": "string"    },    "name": {      "type": "string"    },    "url": {      "type": "string"    }  },  "required": [    "id",    "entry_id",    "media_id",    "revision_id",    "kind",    "folder_id",    "name",    "url"  ],  "additionalProperties": false}