Open in-chat file uploader
create_library_upload_sessionCreates an upload session for local MP4 or PDF files in Trainn Library. Call this in the same turn the user asks to upload, add, or send a local file without a named lesson or cover, except when collecting video editing instructions below. Open the session before requesting or searching for files, even when no file is attached and any uploads folder is empty; file selection is not a prerequisite. The tool needs only an idempotency_key and optional input_prompt and language; file selection happens afterward in the Trainn uploader. Chat attachments cannot be transferred into Trainn. Do not ask users to attach a file in chat or ask what it is for. For video uploads, ask the user: “Would you like to upload your videos as they are, or create new versions with Trainn AI? If you would like Trainn AI to create them, how should the videos turn out?” Wait for the answer before calling this tool unless the user already supplied their choice and instructions. A request describing how the video should turn out chooses Create with Trainn AI; pass it as input_prompt. For Upload original, omit input_prompt. If they choose Trainn AI without instructions, ask how the videos should turn out. One prompt applies to every video in the batch; accept freeform instructions even if some edits are unsupported. Do not ask this for PDFs, lesson uploads or covers. Users can select multiple files or a folder; each file becomes an unpublished Library draft. Supported hosts display an in-chat uploader; other hosts receive a standalone upload link. When the in-chat uploader is ready, do not paste a link; when one upload link is returned, show only that link. get_library_upload_status reports uploaded items after file submission.
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": {
"idempotency_key": "<idempotency_key>"
},
"name": "create_library_upload_session"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | Supported narration language code, e.g. es for Spanish. Omit for the default. | |
| input_prompt | No | Instructions for Create with Trainn AI, applied to every selected video. Supplying instructions selects the agentic upload flow; omit for Upload original. | |
| idempotency_key | Yes |