Для AI-агентов: markdown этой страницы — /docs/mcp-events.mdиндекс документации — /llms.txt
MCP: events
Обновлено
Определения инструментов. Обновляйте tools/list после изменения прав. required_scopes: ALL.
approve_event_registration
Approve an application to an event that admits by approval. The application carries the tickets the buyer chose: ticket type, quantity, seats; while it waits they are not held. Approving opens the buyer's order of those tickets and sends the buyer its payment card; the seats are held for the event's approval_hold_hours (48 h by default, never past the start), unpaid by then the order lapses and the seats are on sale again. A free ticket type gives the tickets at once; an event without ticket types takes its one seat now. To approve another choice, send ticket_type_id with quantity and seat_keys: the buyer gets that choice; the holders the application named go to its first tickets, and more tickets than holders answers HOLDER_INCOMPLETE. No room answers EVENT_SOLD_OUT, STOCK_EXHAUSTED, SEAT_TAKEN or SEAT_GROUP_PARTIAL and nothing changes: approve other seats or another ticket type. An application without a ticket type on an event that sells them answers EVENT_TIER_REQUIRED: send ticket_type_id. One approval opens one order. registration_id is the application number (the `id` of list_event_registrations, status pending). The answer carries the application status after the decision and, when a paid approval opened the buyer's order, its order_id. An application that is already decided answers CONFLICT: read it with get_event_registration.
Scopes (ALL): ["events:write"]. Risk: "write".
cancel_event
Cancel an event by `id`. Final: a cancelled event cannot be reopened (create a new one instead). A listed event leaves the Афиша; its links stay addressable. Registrants are not messaged by this call. Cancelling an already cancelled event changes nothing. Errors: FAILED_PRECONDITION for a completed event; NOT_FOUND for an unknown id.
Scopes (ALL): ["events:write"]. Risk: "destructive".
cancel_event_registration
Cancel a free event registration. A paid registration returns REFUND_REQUIRED and is not cancelled. idempotency_key is required.
Scopes (ALL): ["events:write"]. Risk: "write".
check_in_event_registration
Record operational check-in for an event registration. idempotency_key is required.
Scopes (ALL): ["events:write"]. Risk: "write".
check_out_event_registration
Record that a checked-in participant left the event (the operator side of the exit QR). Sets checked_out_at; the status stays attended. Only a checked-in registration can be checked out (CONFLICT otherwise). A repeat returns the same registration. idempotency_key is required.
Scopes (ALL): ["events:write"]. Risk: "write".
complete_event
Finish a started event by `id`: moves it to `completed`, then sends the post-event content (the post_event chain, or the platform thank-you) to everyone who checked in and the no-show content (the no_show chain, or the platform default) to everyone still registered — except a moment that has its own timer (post_event_offset_minutes / no_show_offset_minutes), which fires by its time instead. Final: a completed event cannot be reopened. Idempotent: calling it again on a completed event moves nothing and sends only what a failed earlier call still owes. Returns `{ event, transitioned }` (`transitioned: false` = it was already completed). Errors: FAILED_PRECONDITION when the event has not started (draft / registration / closed) or was cancelled; NOT_FOUND for an unknown id.
Scopes (ALL): ["events:write"]. Risk: "destructive".
create_event
Create an event. Provide a title; optionally `start_at` / `end_at` (a wall-clock in the event timezone or an ISO instant with an offset; the start must be ahead and the end not before it), `timezone` (the event's own IANA zone; omit to use the business timezone), `address` for an offline event and `stream_url` (https) for an online one, a capacity, a target registration count, the reach pair (`is_active` = switched on at all, default false — a new event is a draft; `is_public` = shown in the Афиша, default true — an active event that is not public is still openable by its link), `is_online` for an online event, and notification flags. `requires_approval` (default false): a registration becomes an application the organizer approves (approve_event_registration) or rejects. `approval_hold_hours` (1..168, default 48): how long an approved application's order holds its seats for the payment; `sale_cutoff_minutes` (0..10080, default 0 = until the start): the sale and the applications close that many minutes before the start. Links are generated automatically. Returns the created event (phase=draft) with its assigned `id`; publish it with set_event_phase.
Scopes (ALL): ["events:write"]. Risk: "write".
create_event_registration
Register a tenant user for an event. Paid tickets return payment_required and intentionally do not create an order or payment here. A free event whose `holder_field_keys` (read it with get_event / list_events) is not empty asks the participant: pass `holder` = { first_name, last_name, fields } with `fields` holding exactly those keys, each filled in; without it the answer is HOLDER_INCOMPLETE and nothing is registered. An event that asks nothing takes no `holder`. On an event that admits by approval this files the application: `catalog_id` names the ticket type (EVENT_TIER_REQUIRED without one when the event sells types), `quantity` and, for a seated type, `seat_keys` (one per ticket) the tickets asked for — nothing is held until the approval; when `holder_field_keys` is not empty, `ticket_holders` names one holder per ticket (HOLDER_INCOMPLETE otherwise); a second application while one waits answers EVENT_APPLICATION_PENDING. `quantity`/`seat_keys` on any other event answer EVENT_APPLICATION_SELECTION_INVALID. idempotency_key is required.
Scopes (ALL): ["events:write"]. Risk: "write".
delete_event
Soft-delete an event by `id`. Idempotent (deleting an absent/already-deleted event returns deleted:true).
Scopes (ALL): ["events:write"]. Risk: "destructive".
get_event
Read one event by `id`: everything list_events returns, plus `description` (the card text the event was published with), `media` (each attachment's type, file name and size) and `qr` — a signed PNG URL with its `expires_at` for each of the registration, check-in and check-out links (each URL expires about 15 minutes after the call). `mini_app_links` (telegram / max / vk) open this page AS the mini app for a post, a broadcast or an old bot: copy the one you need, never build one yourself. A channel the business has not connected has `url: null` and a `reason`; a page that is switched off or link-only (not volunteered) answers `page_not_published` on every channel. 0-cost read. Errors NOT_FOUND for an id this tenant does not have.
Scopes (ALL): ["events:read"]. Risk: "read".
get_event_registration
Read one event registration by its tenant-local registration_id (the `id` of a registration returned by list_event_registrations).
Scopes (ALL): ["events:read"]. Risk: "read".
hold_event_seats
Take seats of an event off sale (a staff block): no buyer, no order and no expiry, the block stays until release_event_seats lifts it. A seat that is already held by a buyer or sold answers SEAT_TAKEN and nothing is blocked; part of a sofa or a box answers SEAT_GROUP_PARTIAL; no seat left answers EVENT_SOLD_OUT. To seat a buyer, create the order for them instead; a sold seat comes back by cancelling its ticket. event_id is the event number (the `id` of list_events) and seat_keys are keys of the event's own hall snapshot frozen at publication, not of the hall's current layout. A sofa or a box is passed with every seat of it.
Scopes (ALL): ["events:write"]. Risk: "write".
list_event_registrations
List event registrations with a bounded cursor (`next_cursor` in the answer); narrow by `event_id` and/or by the person's `user_id`. All identifiers are tenant-local ids: the registration `id`, its `event_id`, `user_id` and `catalog_id`.
Scopes (ALL): ["events:read"]. Risk: "read".
list_events
List the tenant events. Returns each with its `id` (the id you pass to update/delete/get_event/set_event_phase/complete_event), title, phase (draft/registration/registration_closed/started/completed/cancelled), seats (`capacity` = seats in total, `seats_available` = free now; null = no limit), target, `is_cancel_only_via_manager`, `requires_approval` (participation by approval), the sale terms (`approval_hold_hours`, `sale_cutoff_minutes`), `holder_field_keys` (the participant fields a free registration of the event asks; `[]` = none; pass them as `holder.fields` to create_event_registration), reach (`is_active`/`is_public`), online format (`is_online`), notification flags, `address` / `stream_url` (null when unset), `start_at`/`end_at` (UTC instants) with the `timezone` time inputs are read in (the event's own zone when `has_own_timezone` is true, else the business timezone), the automation bindings with their timing (`chains`: the reminder_24h / reminder_1h pairs and the four *_offset_minutes), and ready links: `public_url` (the storefront event page, shown while the event is on and public), `registration_url`, `checkin_url`, `checkout_url` (the landings the platform QR cards encode). `mini_app_links` (telegram / max / vk) open this page AS the mini app for a post, a broadcast or an old bot: copy the one you need, never build one yourself. A channel the business has not connected has `url: null` and a `reason`; a page that is switched off or link-only (not volunteered) answers `page_not_published` on every channel. Card text, media and QR images come from get_event. 0-cost read.
Scopes (ALL): ["events:read"]. Risk: "read".
reject_event_registration
Reject an application to an event that admits by approval. A pending application holds no seat, so a rejection frees nothing and charges nothing; the buyer is told in the chat. registration_id is the application number (the `id` of list_event_registrations, status pending). The answer carries the application status after the decision and, when a paid approval opened the buyer's order, its order_id. An application that is already decided answers CONFLICT: read it with get_event_registration.
Scopes (ALL): ["events:write"]. Risk: "write".
release_event_seats
Put blocked seats of an event back on sale. Only a staff block is lifted: a seat that is free, held by a buyer or sold is not touched and is not in the answer, so a repeat releases nothing. Part of a blocked sofa or box answers SEAT_GROUP_PARTIAL. event_id is the event number (the `id` of list_events) and seat_keys are keys of the event's own hall snapshot frozen at publication, not of the hall's current layout. A sofa or a box is passed with every seat of it.
Scopes (ALL): ["events:write"]. Risk: "write".
set_event_capacity
Set the seats of an event (event_id): capacity is the seats in all, sold ones included. The seats on sale are the smaller of capacity and target_registrations, and the capacity in the answer is that limit; a null capacity leaves target_registrations as the limit, and with neither set the event has no limit. The same write as capacity in update_event. A limit at or below the seats already sold closes the sale (free 0): no sold seat is cancelled. Refused with EVENT_SEATS_BELOW_HELD when buyers hold more seats in checkout than the new limit leaves free, and as invalid input when capacity exceeds the event target_registrations.
Scopes (ALL): ["events:write"]. Risk: "destructive".
set_event_phase
Move an event to `registration` (publishes a draft: switches it on and lists it in the Афиша; or reopens closed registration) or to `registration_closed` (stops accepting registrations; the event stays listed). Opening registration needs `start_at` set and still ahead — set it with update_event first. The event starts by itself at its start time; finish it with complete_event. Asking for the phase the event is already in changes nothing. Returns the event. Errors: FAILED_PRECONDITION with the reason when the move is not allowed from the current phase or the start time is missing or past; NOT_FOUND for an unknown id.
Scopes (ALL): ["events:write"]. Risk: "write".
test_funnel_pipeline
DRY-RUN an event funnel and report where it breaks, without sending anything. Pass `event_id` (the event `id` from list_events); optionally `chain_ids` for chains you are about to bind and want checked first — the event's own eight automation slots are always checked. Returns one row per pipeline stage (registration / qualifier / delay / tripwire / checkout / booking) with a status, plus machine-readable problem codes: a chain that belongs to nobody (CHAIN_NOT_OWNED), is deleted, inactive, has no steps or no entry point; a ticket that is not a ticket (CATALOG_WRONG_SCOPE — an event selling a shop product at the shop price), has no price or is switched off; a tenant selling booking with no live resource. Also reports the total delay in minutes a run would wait (`total_delay_minutes`). NOTHING is enrolled, promoted, sent or written. `not_checked` names what this run did NOT verify — read it before treating ok:true as «the funnel works». 0-cost read.
Scopes (ALL): ["events:read"]. Risk: "read".
update_event
Update an event by its `id`, a partial patch: omitted keys stay, `null` clears. The phase moves with set_event_phase / cancel_event. `start_at` / `end_at`: a wall-clock in the event timezone or an ISO instant with an offset; the start must be ahead, the end not before it; only a draft may lose its start; a finished or cancelled event keeps its times; a started one moves only its end. `timezone`: the event's own IANA zone (`null` = business timezone); times in the same call are read in it, changing it alone keeps the stored instants. `address`, `stream_url` (https) and `is_online` describe the venue. Automation: `{moment}_chain_id` binds a message chain by its `id` (`null` unbinds) for each moment: registration, checkin, checkout, post_event, decline, start_event, no_show, reminder_24h, reminder_1h. `{moment}_chain_step_id` names an ENTRY STEP of that same chain; it is accepted only together with its chain, and a chain without a step starts from the beginning. `catalog_ids`: ticket tiers as tenant-local Catalog ids (integers; the whole list; `[]` unbinds). `capacity` may not exceed `target_registrations`, nor fall below the seats buyers hold in checkout (EVENT_SEATS_BELOW_HELD). `is_cancel_only_via_manager`: a buyer cancels a ticket only through the manager. `requires_approval`: a registration becomes an application the organizer answers; switched off, waiting applications stay decidable. `approval_hold_hours` (1..168, default 48): how long an approved application's order holds its seats; `sale_cutoff_minutes` (0..10080, default 0 = until the start): the sale and the applications close that many minutes before the start. Minutes: `reminder_24h_offset_minutes` / `reminder_1h_offset_minutes` before start_at (5..10080, the first earlier than the second); `no_show_offset_minutes` after start_at, `post_event_offset_minutes` after end_at (0..10080); `null` = only the operator or complete_event fires that moment. Returns the updated event. NOT_FOUND when the event or a catalog id is not your tenant's.
Scopes (ALL): ["events:write"]. Risk: "write".
walk_in_event_registration
Admit a person who came without registering: creates an attended registration marked is_walkin for the tenant user user_id at event event_id (the event must be open for registration or started). A person already registered is simply checked in; one already attended is returned unchanged. Capacity is not checked and no ticket or order is created. idempotency_key is required.
Scopes (ALL): ["events:write"]. Risk: "write".