import_media

Import media from a URL

Fetch a file the client cannot upload itself and store it as an account upload. When the user attaches a picture, clip or sound in ChatGPT, pass it as file; otherwise pass url. The result's reference goes into any generate tool. A file with no URL this server can reach (a claude.ai attachment) needs request_upload_link instead.

Only these hosts are fetched: files.oaiusercontent.com.

Scope

Behaviour

Writes
Creates or changes items in the caller's own account.
Adds or updates
Adds or updates; nothing the caller already has is deleted or overwritten.
Reaches outside
Fetches a file from an allow-listed outside host (such as a ChatGPT attachment) into the caller's library.

Inputs

Example call

A tools/call request with the required arguments only, each a placeholder read off the schema. Replace them before sending.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "import_media",
    "arguments": {}
  }
}

Input schema

As the server sends it in tools/list.

{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri"
    },
    "file": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "download_url": {
              "type": "string",
              "format": "uri"
            },
            "file_id": {
              "type": "string",
              "maxLength": 200
            },
            "mime_type": {
              "type": "string",
              "maxLength": 120
            },
            "file_name": {
              "type": "string",
              "maxLength": 220
            }
          },
          "required": [
            "download_url",
            "file_id"
          ],
          "additionalProperties": false
        },
        {
          "type": "string",
          "maxLength": 2000
        }
      ]
    },
    "filename": {
      "type": "string",
      "minLength": 1,
      "maxLength": 220
    },
    "mime_type": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "additionalProperties": false
}

Related tools

Every tool· This page as Markdown