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

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

MCP: booking

Обновлено

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

booking_assign_resource

Assign a performer or a place to a pending booking that has none. The booking stays pending and no message is sent to the client (only the booking card is updated); confirm it afterwards with `booking_prepare_confirm` → `booking_execute_confirm`, which a booking without a performer cannot go through. Pass `resource_id` to choose one, or null for «любой свободный» — the first resource free at that hour. Refused when the booking already has one, is no longer pending, has no time yet, or nobody is free.

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

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

booking_cancel

Cancel a booking by its `booking_id`, optionally recording why. `cancelled` is TERMINAL — a client who comes back makes a NEW booking, so this is not undoable. Errors CONFLICT when the booking is already in a terminal state (completed / cancelled / no-show); it never reports success for a move it did not make.

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

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

booking_connect_resource_calendar

Start Google Calendar connection for this resource. Returns authorize_url: give it to the owner to approve in their browser. No account is connected until consent succeeds. Reuse the idempotency_key only for the same request; use a new key to start a fresh consent after its ten-minute lifetime.

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

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

booking_copy_resource_schedule_month

Copy one month of a resource's schedule rules (working days, hours, breaks, days off) onto another month — «скопировать график на следующий месяц». `replace: true` deletes the target month's rules first; `false` adds to them. Returns how many rules were copied and deleted. The idempotency_key is mandatory. A retry with the same key and the same fields returns the first answer and repeats nothing.

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

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

booking_create

Place a booking for one end user. `resource_id` may be null — that is «any free master», and the operator assigns one later. `start_at` may be null when the operator will pick the time. For a RANGE («домик с 5 по 15», «сауна с 14:00 до 18:00») pass `end_at` and let the platform count the units — it counts `daily` nights by the tenant calendar, which hand arithmetic gets wrong twice a year. `quantity` is the slot/day multiplier (default 1) and is ignored when `end_at` is given. The length must be one the service offers (`booking_search_availability` returns its `length`: `fixed` = one block, `list` = a count from `allowed_units`, `range` = from `min_units` to `max_units`; `window_start_minute`/`window_end_minute` are the pickup/return hours); otherwise QUANTITY_LIMIT, or OUTSIDE_WINDOW outside those hours. `selected_options` maps an add-on attribute key to its chosen option keys; the quote prices them; `option_quantities` gives the pieces of a selected add-on taken more than once (option key → pieces). `guests` must fit the named place (`resource_id`), otherwise BOOKING_GUESTS_OVER_CAPACITY. The booking is created as `pending`: confirming it requires a separate prepared scenario and final human confirmation. The client is shown the booking card in their chat with the bot, and the operator in the Open Lines topic of that client; do not announce it separately. Refused with a reason when the gate says no (slot taken, too soon, beyond the booking window, per-user limit reached).

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

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

booking_create_resource

Create a booking resource: a person (a specialist) or a place (a room, a cabin, equipment) — set `kind` (default person). The idempotency_key is mandatory: a retry with the same key and the same fields returns the first answer and creates nothing. Hold rules are platform-wide and not configurable: a booking request holds its slot until the operator decides; a paid booking holds it for the prepayment window (15 minutes by default). `chain_bindings` attach auto-funnels to the six moments (booking_confirmed, booking_reminder_24h, booking_reminder_1h, booking_attended, booking_no_show, booking_cancelled) by chain `chain_id` and optional entry-step `step_id`. Booking reminders ARE configurable here: build the reminder as a chain (create_message_chain, then create_chain_step for its message) and bind it to `booking_reminder_24h` / `booking_reminder_1h`. The result carries `public_url` (the resource's public booking page `/booking/{code}` — share it as is, never build one), `kind` (person = who, a specialist; place = where, a room, a cabin, equipment), `location_id` (the number of its business point, list_locations) and `capacity`, the six `chain_bindings` and the Google Calendar `calendar` status. `message_content_id` and `has_photo` describe its OWN media card. Upload/finalize the photo, then call publish_entity with target_topic resources, config {resource_id, etag}. CREATE initializes a missing card; REPLACE with replace_target {kind: card, id: resource_id} replaces its own card.

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

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

booking_create_resource_schedule

Create a monthly resource schedule. The idempotency_key is mandatory.

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

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

booking_create_service

Create a booking SERVICE — the catalog item a client books (a haircut, a sauna hour, a night in a cabin). `mode` is `hourly` (`duration_value` in hours: 0.5, 1, 1.5) or `daily` (`duration_value` in days). `resource_ids` are the masters / rooms that offer it, by their numbers (seq_num — `id` of `booking_list_resources`; at least one). `prices` uses the catalog price list shape; omit it for a free service. Returns the new `catalog_item_id` for `booking_search_availability` and `booking_create`. `length` sets how the buyer picks the length: `length_mode` `fixed` (one block), `list` (`length_units`: allowed block counts) or `range` (`min_units`, `max_units`, hourly `window_start_minute`/`window_end_minute`), and `price_tiers` the price ladder (`{id, units, prices}` ascending by units; absent = linear by the block price); omitted = `range`, linear. To change the booking settings of an existing item use `update_catalog_item`. The idempotency_key is mandatory. A retry with the same key and the same fields returns the first answer and repeats nothing.

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

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

booking_delete_resource

Delete a booking resource with its current etag. It disappears from every list, selector and its public page; its past bookings keep it as their history. Refused while it still has a pending or confirmed booking — cancel, reschedule or reassign those first. Deleting an already deleted resource answers `deleted: true` again. To pause a resource instead, set `is_active: false` with booking_update_resource.

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

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

booking_delete_resource_schedule

Delete a resource schedule with its current etag. The idempotency_key is mandatory.

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

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

booking_disconnect_resource_calendar

Disconnect the resource calendar, stop its push channel and forget its encrypted grant. Booking history is preserved.

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

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

booking_execute_attendance

Record the visit fact identified by a matching prepared scenario. Call this tool only after final human confirmation of the prepared scenario.

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

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

booking_execute_confirm

Confirm the booking identified by a matching prepared scenario. Call this tool only after final human confirmation of the prepared scenario.

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

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

booking_execute_overbooking

Book the overbooking identified by a matching prepared scenario: the visit lands confirmed and marked as overbooked. The client is shown the booking card in their chat with the bot, and the operator in the Open Lines topic of that client; do not announce it separately. Refused when the bookings holding that hour changed since it was prepared — prepare it again. Call this tool only after final human confirmation of the prepared scenario.

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

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

booking_execute_price

Apply the agreed price identified by a matching prepared scenario to the booking's unpaid order; the client's order card shows the new sum. `payment_card` says what happened to a payment card the client already held: `none` (none was out, or a manual one was redrawn), `reissued` (a new card replaces it; it may reach the client a moment after this answer) or `reissue_failed` — the price is saved but no new card was sent, and the card the client holds no longer pays; then `recovery` says how to send a new one. Call this tool only after final human confirmation of the prepared scenario.

Scopes (ALL): ["booking:write","orders:write"]. Risk: "money".

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

booking_get_resource

Get one booking resource by its tenant-local id. The result carries `public_url` (the resource's public booking page `/booking/{code}` — share it as is, never build one), `kind` (person = who, a specialist; place = where, a room, a cabin, equipment), `location_id` (the number of its business point, list_locations) and `capacity`, the six `chain_bindings` and the Google Calendar `calendar` status. `message_content_id` and `has_photo` describe its OWN media card. Upload/finalize the photo, then call publish_entity with target_topic resources, config {resource_id, etag}. CREATE initializes a missing card; REPLACE with replace_target {kind: card, id: resource_id} replaces its own card. `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.

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

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

booking_get_resource_schedule

Get a resource schedule by its tenant-local id.

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

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

booking_get_user_list

List one end user's bookings for this tenant, newest first — status, the service and resource, the time span, the multiplier, and `did_attend` (null = the operator has not marked the visit yet, which is a THIRD value and not a «no»). `user_id` is the tenant-local User id. 0-cost read.

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

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

booking_list

List the tenant's bookings across every client, filtered by start time (`from` inclusive, `to` exclusive, ISO-8601), resource and status, oldest booking number first, with a bounded cursor. A booking whose time is not chosen yet has no start and falls outside any date range. 0-cost read.

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

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

booking_list_pending

List pending bookings across every user of the current tenant. Returns tenant-local booking, service and resource handles with a bounded cursor.

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

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

booking_list_resource_schedules

List monthly resource schedules with a bounded cursor.

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

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

booking_list_resources

List the tenant's bookable resources (masters / rooms / equipment) with their `id` (the `resource_id` you pass to search and create), the services each one currently offers, the slot grid step, and the two reach flags: `is_active` = switched on at all, `is_public` = offered in the shared selector (an active non-public resource is bookable ONLY by its own link, `public_url`). The result carries `public_url` (the resource's public booking page `/booking/{code}` — share it as is, never build one), `kind` (person = who, a specialist; place = where, a room, a cabin, equipment), `location_id` (the number of its business point, list_locations) and `capacity`, the six `chain_bindings` and the Google Calendar `calendar` status. `message_content_id` and `has_photo` describe its OWN media card. Upload/finalize the photo, then call publish_entity with target_topic resources, config {resource_id, etag}. CREATE initializes a missing card; REPLACE with replace_target {kind: card, id: resource_id} replaces its own card. Connecting a Google Calendar is an OAuth consent only the OWNER can give, by opening the authorize_url returned by booking_connect_resource_calendar; the agent starts the connection and the owner approves once. `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. Call this first — `booking_search_availability` needs a service that some resource actually offers. 0-cost read.

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

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

booking_list_reviews

List the visit reviews clients left, newest visit first, with a bounded cursor. Each carries the visit's `booking_id` (its address), `resource_id`, `user_id`, the 1–5 `rating`, the `text`, `status` (`pending` = not judged yet, `published` = shown on the public booking page, `hidden` = not shown) and `verdict_by` (`ai` = the automatic moderation decided, `person` = the owner or an operator did). Filter by status, resource and the time the review was left (`from` inclusive, `to` exclusive). 0-cost read.

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

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

booking_prepare_attendance

Prepare the attended or no-show fact for a booking. Show the immutable prepared scenario to the human before calling booking_execute_attendance. This records the visit without sending a client notification.

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

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

booking_prepare_confirm

Prepare confirmation of a pending booking. Show the immutable prepared scenario to the human before calling booking_execute_confirm.

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

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

booking_prepare_overbooking

Prepare a booking ON TOP of an hour another booking already holds — the operator's deliberate double booking. Returns the immutable prepared scenario naming who holds that hour (their `booking_id`, `user_id`, status) to show the human before calling booking_execute_overbooking. A free hour is refused — book it with booking_create. Changes nothing by itself; clients booking themselves are still refused an occupied hour.

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

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

booking_prepare_price

Prepare an agreed individual price for the UNPAID order behind a booking (the operator's «изменить цену»). `amount` is a decimal string in the order's own currency. Returns the immutable prepared scenario — the current amount, the new amount and the currency — to show the human before calling booking_execute_price. Refused when the booking is already paid, free, or over, and when its order cannot take this sum: it does not split over the booked quantity, or no connected payment rail charges in the order currency. Changes nothing by itself.

Scopes (ALL): ["booking:write","orders:write"]. Risk: "write".

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

booking_reschedule

Move an active booking to a new start (`start_at`, ISO-8601). The booking keeps its service, performer and length; the client's card is updated. Refused with the reason when the hour is taken, the booking is already over, or it changed meanwhile — it never reports a move it did not make.

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

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

booking_search_availability

Find free booking slots for a service over a date range. `catalog_item_id` is the service (a Catalog row with `catalog_scope` `booking`); omit `resource_id` (or pass null) to search EVERY master/room that offers it. Dates are `YYYY-MM-DD` in the tenant timezone, both inclusive. Each slot carries its start/end, the resource that would take it, and `bookable` — a slot beyond the booking window comes back visible but NOT bookable. The grid is computed under the same gate `booking_create` enforces, so a `bookable: true` slot is one this agent can actually take. The reply also carries the service `length` (mode, allowed units or min/max, pickup/return window): a slot is ONE block, so size the booking with `end_at` or `quantity` inside it. 0-cost read.

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

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

booking_set_review_visibility

Publish or hide one visit review — the owner's or operator's own decision, which overrides the automatic moderation in either direction and is not undone by it. Only `published` reviews appear on the public booking page. Recorded with who decided and when. The idempotency_key is mandatory: a retry with the same key and the same choice returns the first answer.

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

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

booking_share_recording

Send the cloud recording of an online meeting to the buyer: booking_id is the booking number (its seq_num), message_id is the id of the recording message in the booking user's topic, as `get_conversation` lists it. The Hub copies exactly that message to the buyer's private chat, and only when it belongs to the topic of this booking's user — any other message answers NOT_FOUND and decides nothing. The verdict is taken once per booking, by the operator or by this tool — a booking that already has one answers CONFLICT. Not undoable: the buyer receives the file.

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

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

booking_update_resource

Update a booking resource with its current etag. The idempotency_key is mandatory. Sparse: an absent field — and an absent moment inside `chain_bindings` — is left as it is; `chain_id: null` unbinds a moment. Reminders before the visit are the moments `booking_reminder_24h` and `booking_reminder_1h` of `chain_bindings`. The result carries `public_url` (the resource's public booking page `/booking/{code}` — share it as is, never build one), `kind` (person = who, a specialist; place = where, a room, a cabin, equipment), `location_id` (the number of its business point, list_locations) and `capacity`, the six `chain_bindings` and the Google Calendar `calendar` status. `message_content_id` and `has_photo` describe its OWN media card. Upload/finalize the photo, then call publish_entity with target_topic resources, config {resource_id, etag}. CREATE initializes a missing card; REPLACE with replace_target {kind: card, id: resource_id} replaces its own card.

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

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

booking_update_resource_schedule

Update a resource schedule with its current etag. The idempotency_key is mandatory.

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

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

booking_withhold_recording

Decide that the cloud recording of an online meeting is NOT sent to the buyer: booking_id is the booking number (its seq_num). The verdict is taken once per booking, by the operator or by this tool — a booking that already has one answers CONFLICT. Nothing is sent to the buyer; to send the recording use booking_share_recording.

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

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

confirm_booking

Confirm a pending booking in one step (the «Подтвердить» button): confirms every pending line of its order and moves the order to the stage the business set for confirmation, or «В работе» when none is set. The reviewed pair booking_prepare_confirm → booking_execute_confirm does the same behind a human-review receipt.

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

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

create_location

Create a business point: a title, and optionally the address, the map point (geo_lat with geo_lng) and the opening hours. With more than one active point the buyer picks a point first, so bind every resource to its point. `id` is the point number (its seq_num): pass it as `location_id` here and to booking_create_resource / booking_update_resource. `opening_hours` is the week in local time; a day that is absent is a day off.

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

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

delete_location

Delete a business point by location_id (its seq_num). It disappears from every list and from the point picker of the buyer; resources and events bound to it keep the binding as history. Deleting a point that is already deleted answers NOT_FOUND.

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

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

get_hall_layout

Read the seat plan of a hall: the layout as it was saved, every seat with its key, drawing position and ticket type, the capacity (seats plus standing places) and the version. Omit version for the current layout. The hall is a booking resource of kind place: resource_id is its number (the `id` of booking_list_resources). Seat keys are built by the server as zone:row:seat (a seat of a sofa, a box or a table: zone:g1:seat, g1 being the position of the group in the zone), never typed by hand: read them with get_hall_layout. A hall without a layout answers NOT_FOUND: set it with put_hall_layout.

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

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

get_location

Read one business point by location_id. `id` is the point number (its seq_num): pass it as `location_id` here and to booking_create_resource / booking_update_resource. `opening_hours` is the week in local time; a day that is absent is a day off.

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

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

list_locations

List the business points (addresses where resources work) in number order, `limit` per page; pass `next_after_id` as `after_id` for the next page. Deleted points are not listed. `id` is the point number (its seq_num): pass it as `location_id` here and to booking_create_resource / booking_update_resource. `opening_hours` is the week in local time; a day that is absent is a day off.

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

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

meeting_provider_connect

Start connecting the business's Zoom or Яндекс Телемост account with any authorized tenant credential, in which video-format bookings get their meeting link 5 minutes before the start. Returns `consent_url` — give it to the OWNER to open in their browser and approve; it works once and expires at `expires_at` (10 minutes). Nothing is connected until they approve; then meeting_provider_status shows the account. Connecting again replaces the account. Refused for a provider not enabled on this installation.

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

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

meeting_provider_status

Which video-meeting providers this business can use: per provider, `available` (enabled on this installation), `connected`, the connected account (`account_label`, e-mail or login) and `resource_ids` — the resources whose meetings open there. 0-cost read.

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

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

put_hall_layout

Set the seat plan of a hall in the compact format: zones, each a ticket type (ticket_type_id, the number of an event ticket position) with rows (label, seats), sofas, boxes and tables (groups: label, seats, sold_as whole or seat) or a standing capacity (no seats). Send the whole layout; it is saved as the next version and the earlier versions stay. Events already published keep the layout they were published with, so a new layout reaches only events published after it. The hall is a booking resource of kind place: resource_id is its number (the `id` of booking_list_resources). Seat keys are built by the server as zone:row:seat (a seat of a sofa, a box or a table: zone:g1:seat, g1 being the position of the group in the zone), never typed by hand: read them with get_hall_layout. A broken layout answers SALE_CONFIG_INVALID with every broken rule at once (a zone whose ticket type is not an event ticket of this business, a repeated zone key, a standing zone with seats, a layout on a resource that is not a place). Read it back with get_hall_layout.

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

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

resource_set_meeting_provider

Choose where a resource's video meetings open: a CONNECTED provider (see meeting_provider_status), or `none` to stop creating meeting links for it. A provider that is not connected yet is refused — the owner connects it with meeting_provider_connect first.

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

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

update_location

Update a business point by location_id. Sparse: an absent field is left as it is, null clears it; geo_lat and geo_lng change together. is_active false hides the point without deleting it. `id` is the point number (its seq_num): pass it as `location_id` here and to booking_create_resource / booking_update_resource. `opening_hours` is the week in local time; a day that is absent is a day off.

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

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