К содержанию
TelegaFirst

Для AI-агентов: markdown этой страницы — /docs/mcp-content.mdиндекс документации — /llms.txt

MCP: content

Обновлено

Определения инструментов. Обновляйте tools/list после изменения прав. required_scopes: ALL.

get_content_draft

Read back one content draft by the tenant-scoped `draftHandle` publish_entity returned: its publish status (pending | publishing | published | failed | cancelled), the assigned `seqNum` once published, and the failure reason when it failed. This is the poll target for every async content write. 0-cost read.

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 `mediaRef` 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 `albumSendable`: when false the files cannot travel as ONE Telegram album (only photos and videos mix; documents ride alone) and must be published separately. Fails if nothing was uploaded.

Scopes (ALL): ["content:write"]. Risk: "write".

Вход, результат и права

media_get_status

Check which files of an upload have arrived, without closing it. Use while waiting for direct presigned PUTs to finish. An empty list means nothing has landed yet, not that the id is wrong. 0-cost read.

Scopes (ALL): ["content:read"]. Risk: "read".

Вход, результат и права

media_import_files

Import files exposed by your AI host through short-lived HTTPS download URLs. The server streams each source into immutable tenant storage, verifies it, and returns durable mediaRefs for publish tools. Never pass bytes, base64, or a local path.

Scopes (ALL): ["content:write"]. Risk: "write".

Вход, результат и права

media_request_upload

Step 1 of 2 — reserve immutable write-once slots for images or video. Declare each file with `mime_type` and exact `size_bytes`; the response contains an `uploadId` and one presigned PUT URL per file. PUT every declared byte directly, then call `media_finalize`.

Scopes (ALL): ["content:write"]. Risk: "write".

Вход, результат и права

publish_entity

Create, replace or restore content cards in the client's Telegram Settings supergroup — catalog items, order statuses, marketing campaigns, broadcasts, message-chain steps, events. Pass `items:[…]`: one call imports a whole batch (mixed topics allowed), each item carrying its card text (and any `mediaRefs` from media_finalize) plus the `config` fields for its targetTopic. The reply is per element: `results[i]` is `ok` with a tenant-scoped `draftHandle` while publishing, or the entity `seqNum` when available; one bad item never aborts the rest. Poll `get_content_draft` with a returned `draftHandle`. Retrying the identical request is safe. Batch size is capped by your plan; over it, nothing is written.

Scopes (ALL): ["content:write"]. Risk: "write".

Вход, результат и права