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

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

MCP: pull

Обновлено

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

export_form_submissions_normalized

Export one form's submissions as a FLAT table — one row per submission, one column per answer field, headers in alphabetical order — so you never have to unpick raw JSON. Columns are `created_at` (in the business's own timezone), `id`, `status`, `linked_user_id`, `channel`, then every field name that form has ever collected. Returns an `export_id`; poll the exports endpoint for the download link (it is a temporary signed URL). One export runs at a time per key. This file DOES contain the answers themselves — it is the sanctioned way to hand the owner their own data, so tell them where it came from and do not paste its contents back into the conversation.

Scopes (ALL): ["pull:form_submissions"]. Risk: "write".

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

get_form_submission

Read ONE submission by its own `id` (the id you pass to get and to `set_form_submission_handled`), not the form id or public code. Same fields as `pull_form_submissions`, and the same rule about the answers: 🔴 `payload` is returned only with `include: "full_payload"`, and that opt-in writes an audit row naming the api key, the form and the moment. A submission id that belongs to another account simply does not exist here. 0-cost read.

Scopes (ALL): ["pull:form_submissions"]. Risk: "read".

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

get_order

Read one order by its `id`: status, amount, the customer by id, payments and order lines with products by catalog_id. 0-cost read.

Scopes (ALL): ["pull:orders"]. Risk: "read".

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

get_personal_offer

Read one personal offer: id is the offer number «П-N» (its seq_num). Answers its status (sent, accepted, expired, revoked), the buyer user_id, the term and its lines with the final unit_price.

Scopes (ALL): ["pull:orders"]. Risk: "read".

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

list_orders

List orders of the current tenant, newest first, filtered by status, is_paid, creation time and customer. Each order has id, status, amount, currency and times. status paid means the order was closed successfully; is_paid means the payment was received. The two can differ: an order closed successfully without a payment, or a paid order canceled later. Up to 100 per page (default 20); pass meta.next_cursor as cursor to read the next page. 0-cost read.

Scopes (ALL): ["pull:orders"]. Risk: "read".

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

list_personal_offers

List the personal offers of the business, newest first: optional status (sent, accepted, expired, revoked) and user_id (the buyer, their seq_num). A sent offer past its term reads expired. Each offer carries id (the number «П-N», its seq_num), the buyer user_id, the term, and its lines with the final unit_price. Pass the answer's next_before as before for the next page.

Scopes (ALL): ["pull:orders"]. Risk: "read".

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

pull_form_submissions

List the submissions this business's own hosted forms collected, newest first. Returns the submission `id` (the id you pass to get and to `set_form_submission_handled`), its separate public `submission_code`, `created_at`, `status` (`anonymous` = the visitor has not been matched to a messenger user yet, `linked` = they have), `form_id` with the form title as it was at the time, and — once linked — `linked_user_id` and `channel`. Filter by `form_id` (the id `site_form_declare` returned), `status` and a date range; page with the opaque `cursor` from the previous answer. 🔴 The ANSWERS THEMSELVES are not included: what a visitor typed is personal data, so `payload` comes back only if you pass `include: "full_payload"`, and that opt-in is recorded in the account's audit trail. Do not pass it to count leads or to check whether a form works — this call already tells you that. Pass it only when the owner asked you to read the actual answers.

Scopes (ALL): ["pull:form_submissions"]. Risk: "read".

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

query_form_submission_segment

Turn form answers into an AUDIENCE: given a form and one or more `(key, value)` pairs the visitor answered, get back `user_ids` — the ids of the users who answered that way — plus `segment_selection`, an entry you can drop UNCHANGED into the `include` or `exclude` list of a broadcast's segment. All the pairs must hold together (AND). There is no `or` and no `not`, and none is needed: for "A or B" call twice and put both results in `include` (that list is a union); for "A but not B" put the second result in `exclude`. 🔴 This call never returns what anyone wrote — only WHO wrote it. `truncated: true` means the account's 5000-recipient cap cut the list short, so narrow the pairs rather than sending to a partial audience.

Scopes (ALL): ["pull:form_submissions"]. Risk: "read".

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