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

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

MCP: broadcasts

Обновлено

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

create_broadcast

Create a rich broadcast draft in one call — one identical message to a segment; for a personal text to each customer use prepare_reply_batch instead. Choosing the path: a personal text for each customer goes through prepare_reply_batch then execute_reply_batch; one identical message to a whole segment goes through broadcasts (create_broadcast). Give required `content` and optional structured `segment_filter`, schedule, delivery target, reply setting, TTL and button. People who refused advertising are left out unless `include_opted_out` is true, which is the client's own risk. This never sends. The text may address each recipient: {first_name}, {last_name}, {full_name} are filled per recipient (empty when the recipient has none); any other `{name}` is sent as written and `warnings` names it. The declared rich-launch workflow has exactly four calls: create_broadcast, one get_content_draft poll that must return published `id`, prepare_broadcast_launch, then (only after final human confirmation) execute_broadcast_launch. If that one poll is not published, stop: it is not a hidden retry budget.

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

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

create_saved_segment

Save a named audience filter. Conditions use the canonical segment axes; recursive saved-segment references are rejected. This never sends a broadcast.

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

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

delete_broadcast

Soft-delete a broadcast by `id`. Idempotent (deleting an absent/already-deleted broadcast returns deleted:true).

Scopes (ALL): ["broadcasts:write"]. Risk: "destructive".

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

delete_saved_segment

Delete a named filter by id and expected_version. Detach every broadcast reference first; referenced or stale deletion is rejected.

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

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

describe_segment_axes

Describe the audience taxonomy you build a broadcast segment from: categories → axes → (for entity axes) their `{id, title}` targets. Use it to discover the `kind`/`key`/`target_ids` that make up a SegmentFilter. Ids are per-tenant (never internal ids). 0-cost read.

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

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

execute_broadcast_launch

Launch the reviewed broadcast from its matching prepared scenario. Call this tool only after final human confirmation of the prepared scenario.

Scopes (ALL): ["broadcasts:write"]. Risk: "money".

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

get_broadcast_status

Poll a broadcast by `id`: returns its engine-driven status (draft/scheduled/sending/completed/failed/cancelled) and the latest execution progress (recipients/sent/failed), or null execution if it was never launched, plus `mass_send_ready`/`mass_send_state`: launch only when mass_send_ready is true — `preparing` means the content is not published yet, `unavailable` means its file belongs to another bot and the content must be published again. Use after execute_broadcast_launch to watch a launch to completion. 0-cost read.

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

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

get_saved_segment

Read a named filter and its current version by per-tenant id.

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

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

list_broadcasts

List the tenant broadcasts. Returns each with its `id` (the one you pass to update/delete), engine-driven status (draft/scheduled/…/completed — read-only), audience description, schedule, TTL and optional button. 0-cost read.

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

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

list_saved_segments

List named audience filters. id is the per-tenant id you pass to get/update/delete. Follow next_after_id (pass it as after_id) to download the complete list.

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

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

list_segment_targets

List the second-level targets of a segmentation `kind` (e.g. the products for `commerce`, the events for `event`) as `{id, title}` rows, optionally filtered by a `search` substring. The `id` is what you put in a selection's `target_ids`. 0-cost read.

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

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

prepare_broadcast_launch

Prepare launch of a broadcast by its tenant-local `id`. Review the immutable prepared scenario with a human before execution; this tool never sends a message or spends balance. Choosing the path: a personal text for each customer goes through prepare_reply_batch then execute_reply_batch; one identical message to a whole segment goes through broadcasts (create_broadcast).

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

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

preview_segment_reach

Estimate how many people a `filter` reaches BEFORE you attach it to a broadcast. Returns {valid, issues, reachable}: a malformed filter is a LOUD zero (valid:false + issues telling you what to fix), so you can tell "your filter is broken" from "the segment is genuinely empty". `reachable` is the reach of a mass broadcast: people whose latest marketing consent is a refusal are not counted. Build the filter from describe_segment_axes. 0-cost read.

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

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

sample_segment_audience

Return a bounded SAMPLE of the people a `filter` resolves to, as `recipients`: per-tenant `user_id` (contacts) and `marketing_consent` (true granted, false refused advertising, null no record) — to pick recipients of a personal batch or spot-check a segment. People who refused advertising ARE in the sample: a personal message is not a mass broadcast. Sending advertising text to a recipient with marketing_consent=false is at the client's own risk. A malformed filter is rejected (fix it with preview_segment_reach first); this never returns a sample from a filter it could not parse. Scope: broadcasts:read. 0-cost read.

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

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

update_broadcast

Update a broadcast draft by its `id` (a partial patch — send only the fields you change; `status` is NOT settable here). Idempotent. Returns the updated broadcast. Errors NOT_FOUND if the id does not exist for your tenant.

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

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

update_saved_segment

Update a named filter by id and expected_version. Existing draft broadcast references see the new filter until launch; launched executions retain their snapshot. A stale version is rejected.

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

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