Подключить Яндекс.Метрику
connect_analyticsConnect Yandex Metrika to a site.
IMPORTANT: authorisation happens IN A BROWSER, and neither you nor the
platform can do that step for the user. The tool returns a link — show
it and ask them to open it and grant access. Do not poll in a loop: the
person may walk away for an hour. Check later through this same tool
without the `branch` argument, or through `site_analytics`.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project": "<project>"
},
"name": "connect_analytics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | No | The branch whose traffic is counted. Defaults to the production branch; pass it only when the user asks to track a preview branch. | |
| project | Yes | The project: its slug (`my-site`) or id, as listed by `my_projects`. The site address works too (`https://clear-garden-vypm.layero.app` or just `clear-garden-vypm`) — note that the address host is NOT always the slug. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| connected | Yes | ||
| oauth_url | No | ||
| counter_id | No | ||
| next_action | Yes | ||
| injection_mode | No | ||
| tracked_branch | No |