Для AI-агентов: markdown этой страницы — /docs/mcp-content.mdиндекс документации — /llms.txt
MCP: content
Обновлено
Определения инструментов. Обновляйте tools/list после изменения прав. required_scopes: ALL.
get_content_draft
Check a content write by the draft_handle it returned. published: the message is out; bound: it is attached to its item and id names that item. Published but not bound: poll again. A failed or cancelled write has stopped; failure.code says why and failure.recovery, when present, how to correct the request. This read is free.
Scopes (ALL): ["content:read"]. Risk: "read".
get_share_links
Get ready links to share content of your business: up to 5 items, each {content_type, id} (product, catalog_group, menu_group, event, resource, chain, chain_step, marketing_campaign, marketing_link, form, site_page). Each item returns landing (works in every channel and browser), channels (a redirect into the bot per channel the business switched on), mini_app (opens the page of a product, event, resource, form or site page in the mini app; null with a reason otherwise) and, with with_qr: true, a QR of the landing. A site_page item also returns links, the page's whole set (web, universal, one mini_app per connected channel) that site_list_pages returns too; empty with links_recovery while the page is not served. Hand these links out as they are: never build a link from a code, a slug or a number. Requires the read scope of the content domain as well.
Scopes (ALL): ["content:read"]. Risk: "read".
media_finalize
Step 2 of 2 — close an upload and get the media references to publish with. PREREQUISITE: every declared byte was PUT to its returned write-once URL. Returns one media item (with its `media_ref`) per file that actually landed — pass those verbatim as media on a publish tool; they are storage references, not links, and the platform signs a fresh fetchable URL at send time. Also returns `album_sendable`: when false the files cannot travel as ONE Telegram album (only photos and videos mix; documents ride alone) and must be published separately. And `mass_send_ready` with `mass_send_state`: a file for a broadcast or a reply batch to many customers must be ready first — `preparing` means a large file is being prepared once, poll media_get_status(upload_id) until mass_send_ready is true; `unavailable` means it could not be prepared for now: send again in about an hour without uploading the same file again, and if it keeps failing check that the Open Lines group is connected. Fails if nothing was uploaded.
Scopes (ALL): ["content:write"]. Risk: "write".
media_get_download_link
Get a short-lived download link for one committed media file of this business, to open it or hand it to a person. Pass a `media_ref` from media_finalize, media_import_files or media_get_status. Returns a link and its `expires_at`; after that, call again for a fresh one. No file bytes pass through this call.
Scopes (ALL): ["content:read"]. Risk: "read".
media_get_status
Read an upload or import outcome without finalizing it. IMPORTING: a media_import_files transfer is still running, poll again. STAGING: no outcome yet (presigned PUTs not finalized, or an import to repeat with the same idempotency_key). FAILED carries `failure.code` and limit details. Only COMMITTED returns publishable descriptors, with `mass_send_ready`/`mass_send_state` for a send to many customers. 0-cost read.
Scopes (ALL): ["content:read"]. Risk: "read".
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.
Scopes (ALL): ["content:write"]. Risk: "write".
media_request_upload
Step 1 of 2 — reserve immutable write-once slots for photos, videos and documents of any size; this is the way for every file above 128 KiB, and a large file is never printed as base64. Optional `media_kind` declares voice, audio or video_note and is verified against the uploaded bytes. Declare each file with `mime_type` and exact `size_bytes`; the response contains an `upload_id` and, per file, a presigned PUT URL with the `required_headers` and a ready `curl` command: replace FILE_PATH in it with the file's local path and run it. Without a shell, PUT every declared byte to `put_url` with those headers. Then call `media_finalize`.
Scopes (ALL): ["content:write"]. Risk: "write".
publish_entity
Create or replace the content of business items in one call: catalog items, order statuses, marketing campaigns, broadcasts, chain steps, events and booking resources. Each item carries target_topic, intent, content (text and/or media_refs from media_finalize or media_import_files) and the config of its topic. CREATE makes a new item; REPLACE swaps the content of an existing one (replace_target.id) and keeps its number; RESTORE brings a deleted one back; INITIALIZE_DELIVERY adds the first after-purchase message to a catalog item (initialize_target.id). A booking resource photo takes CREATE/REPLACE only, with config.resource_id and config.etag. Each result returns id once the item is ready, or a draft_handle to poll with get_content_draft. One bad item never stops the others, repeating the same request is safe, and the batch size follows your plan.
Scopes (ALL): ["content:write"]. Risk: "write".