Для AI-агентов: markdown этой страницы — /docs/mcp-tool-media-import-files.mdиндекс документации — /llms.txt
media_import_files
Обновлено
Import up to 10 media files into tenant storage and get media items (each carries a `media_ref`) for publish tools. ChatGPT fills `files` with the files the user attached. Other hosts pass `sources`, each with a `url`: an https address of the business site or an allowed file host, or, for a SMALL file you hold as bytes (up to 128 KiB decoded, such as an icon or a preview), data:<mime>;base64,<payload> together with its exact `byte_length` and optionally `sha256`; the type is checked against the bytes. A larger file is never printed as base64: reserve it with media_request_upload, PUT it, then call media_finalize. A Claude chat attachment has no URL: the user uploads it in the web cabinet or the Mini App, or puts it on the business site and you pass that URL in `sources`. Local paths are not accepted. Optional `media_kind` (voice, audio, video_note) is checked against the bytes. Large files import in the background: COMMITTED returns the media items; IMPORTING returns an upload_id, then poll media_get_status(upload_id) until COMMITTED; STAGING means repeat this call with the same idempotency_key. One idempotency_key names one set of files: other files need a new key.
Права и условия
required_scopes: ALL.
| Поле | Значение |
|---|---|
| description | "Import up to 10 media files into tenant storage and get media items (each carries a `media_ref`) for publish tools. ChatGPT fills `files` with the files the user attached. Other hosts pass `sources`, each with a `url`: an https address of the business site or an allowed file host, or, for a SMALL file you hold as bytes (up to 128 KiB decoded, such as an icon or a preview), data:<mime>;base64,<payload> together with its exact `byte_length` and optionally `sha256`; the type is checked against the bytes. A larger file is never printed as base64: reserve it with media_request_upload, PUT it, then call media_finalize. A Claude chat attachment has no URL: the user uploads it in the web cabinet or the Mini App, or puts it on the business site and you pass that URL in `sources`. Local paths are not accepted. Optional `media_kind` (voice, audio, video_note) is checked against the bytes. Large files import in the background: COMMITTED returns the media items; IMPORTING returns an upload_id, then poll media_get_status(upload_id) until COMMITTED; STAGING means repeat this call with the same idempotency_key. One idempotency_key names one set of files: other files need a new key." |
| domain | "content" |
| name | "media_import_files" |
| platform_version | "1.0.34" |
| required_scopes | ["content:write"] |
| risk | "write" |
| scope | "content:write" |
| title | "Media Import Files" |
Входные параметры
media_import_files: inputSchema