Skip to main content
Glama

Get an upload address for a file

prepare_course_file
Idempotent

Reserves 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

NameRequiredDescriptionDefault
kindYes'file' (a document: PDF, Word, slides, text), 'photo' (a picture of pages or a whiteboard) or 'recording' (audio or video).
nameYesThe file's original name with its extension, e.g. 'week 3 notes.pdf'.
bytesYesThe exact size of the file in bytes.
draftIdYesThe draftId start_document_course returned (or list_drafts shows).
requestIdYesA 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.
destinationNoWhere the course goes: 'personal' (the person's own soclever library, the default) or 'teaching' (a teacher's classes).personal
recordingConsentNoRecordings 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

NameRequiredDescriptionDefault
okYes
dataNo
errorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations it discloses the important traits: the address is single-use, expires in upload.expiresInSeconds, needs no soclever credential, and must not be shown or stored. It also explains the idempotent retry contract (same requestId while nothing uploaded returns a fresh address; a different failed command says nothing about this upload) and the recordingConsent limitation that soclever cannot verify.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is correctly front-loaded, but the body is a dense run-on paragraph with a long inline curl example and a digression about unrelated commands and the assistant's session settings that is hard to parse and only loosely tied to invoking this tool. Roughly a third of the text could be trimmed without losing the calling contract.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a seven-parameter mutating tool with a real upload handshake, the description covers the missing pieces an agent needs: expiry, credential-free single-use URL, the exact one-request PUT procedure, the follow-up call, the retry contract, the fallback path and the consent requirement. Return values are also summarized (upload fields and the state lifecycle) even though an output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage the baseline is 3, but the description adds practical meaning: bytes is the exact size with concrete derivation hints (wc -c, stat, ls -l), and recordingConsent is framed as the person's own attestation rather than a verifiable flag. The requestId and kind semantics are largely restated from the schema, so it stops short of 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb and resource: 'Reserves one file in a draft and returns a one-file upload address', then enumerates exactly what the address contains (url, method, headers, expiry). It cleanly separates this tool from the sibling it is not: add_course_text is named as the text-only fallback when an upload cannot be done.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives the selecting condition explicitly (use this route to keep the original layout, pictures, charts and scans; the file does not need extraction or conversion first) and names the alternative with its tradeoff (add_course_text keeps text only, no original file). It also states the ordering rule ('complete_course_file is called after it') and what to do when the person declines.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources