Get an upload address for a file
prepare_course_fileReserves one file in a draft and returns a one-file upload address (upload: url, method, headers and expiry). soclever keeps the original file (its layout, pictures, charts and scanned pages) only when it is uploaded this way; the file does not need to be read, extracted or converted first. bytes is the file's exact size in bytes (for example from wc -c < file, stat or ls -l). The upload is ONE plain request on its own: an HTTP PUT of the file's raw bytes to upload.url with exactly the headers in upload.headers, before upload.expiresInSeconds runs out. Any tool that can send a raw file body works and a shell is not required; with a shell, for example curl -X PUT --data-binary @file -H 'content-type: <upload.headers content-type>' '<upload.url>'. complete_course_file is called after it. Each command is independent: a different command that failed earlier says nothing about this upload, and a command blocked by the assistant's own session settings is not the person declining. The upload never needs the person to run a command themselves; when the person declines the upload itself, it is not repeated, and add_course_text can send the text instead if they agree. The upload address is single-use and needs no soclever credential. It appears in the upload request itself; it is not meant to be shown in messages, stored or sent anywhere else. While nothing has been uploaded, the same request again (same requestId) returns a fresh address for the same file. add_course_text is the fallback when the upload cannot be done: it keeps the text only, without the original file, its layout, pictures and charts, unread scans or page references, and the person can still replace it with the original before planning. A recording needs recordingConsent true: the person's own statement that everyone recorded agreed, which soclever cannot check. state: upload_ready (the address is ready), uploaded (bytes are there; complete_course_file is next), reading, ready, failed (see get_document_course_status), missing (the file is gone), reserving (the same request again shortly returns the address).
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": {
"requestId": "<requestId>",
"draftId": "<draftId>",
"kind": "<kind>",
"name": "<name>",
"bytes": "<bytes>"
},
"name": "prepare_course_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | 'file' (a document: PDF, Word, slides, text), 'photo' (a picture of pages or a whiteboard) or 'recording' (audio or video). | |
| name | Yes | The file's original name with its extension, e.g. 'week 3 notes.pdf'. | |
| bytes | Yes | The exact size of the file in bytes. | |
| draftId | Yes | The draftId start_document_course returned (or list_drafts shows). | |
| requestId | Yes | A random UUID, not derived from names, dates or any other content, that identifies one intended action. A retry of that same action uses the same UUID with identical arguments and returns that action's result; each new action has a new UUID. A UUID already used with different arguments is refused (request_conflict); one used for an earlier action returns that earlier result. | |
| destination | No | Where the course goes: 'personal' (the person's own soclever library, the default) or 'teaching' (a teacher's classes). | personal |
| recordingConsent | No | Recordings only: true is the person's own statement that everyone recorded agreed to it being used; soclever cannot check it. Omitted for other files. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| error | No |