create_upload

Upload an image with Wavegrain's MCP server: the create_upload tool needs the write permission. Inputs, outputs and an example call.

Upload an image. Permission: write. Changes saved work.

Get a 10-minute upload link for an image (JPEG, PNG or WebP, up to 15 MB), or send one under 150 KB inline. Free.

Inputs

InputTypeRequiredNotes
filenamestringyesThe file's name; it becomes the image title. up to 200 characters
contentType"image/jpeg" | "image/png" | "image/webp"yesThe file's image type; send it as the Content-Type.
bytesintegeryesThe file size in bytes. Over 15 MB is refused: resize first. 1 to 9007199254740991
dataBase64stringnoOnly for clients without a sandbox: the whole image, under 150 KB, inline. up to 220000 characters

The fields inside an object or a list are in the JSON Schema at /developers/mcp-tools.json.

Returns

FieldTypeNotes
uploadIdstringThe upload id, for uploadId inputs.
uploadUrlstring | nullSend the file here; null when dataBase64 already stored it.
method"PUT" | nullThe HTTP method for uploadUrl.
headersobject | nullHeaders to send with the file.
expiresAtstring | nullWhen uploadUrl stops working, ISO 8601.
imageIdstring | nullThe stored image id; null until the file is sent.
imageobjectThe image object: put it in a slide's image slot as is.
notestringWhat to do next.

Example call

Send it to POST https://wavegrain.com/api/mcp with an access key that has the write permission; Authentication shows how to make one.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_upload",
    "arguments": {
      "filename": "<filename>",
      "contentType": "image/jpeg",
      "bytes": 1
    }
  }
}

The call shows only the required inputs, with placeholder values: put your own in.

Something wrong or missing? Write to support@wavegrain.com.