> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Herramientas para reglas de targeting

> Herramientas MCP para vincular un segmento y un trigger a un experimento.

Las herramientas de reglas de targeting controlan qué visitantes ven un experimento y cuándo se activa. Cada experimento tiene una regla de targeting que combina un segmento y un trigger, y estas herramientas cambian ambos.

## Herramientas

| Herramienta | Descripción | Prompt de ejemplo |
| - | - | - |
| `targeting_rule_list` | Lista las reglas de targeting de un sitio. | "List targeting rules for site `d1alzzxd7k`." |
| `targeting_rule_get` | Revise una regla de targeting concreta (segmento, configuración, trigger y el experimento al que pertenece). | "Show targeting rule `118605`." |
| `targeting_rule_update` | Cambie el segmento o el trigger que dirige un experimento, y su configuración. Solo cambian los campos que pase. La herramienta rechaza las configuraciones no válidas sin escribir nada. | "Target experiment `149640` to segment `200604`." |
| `targeting_rule_create` | Añada una regla de targeting a un experimento que no tiene ninguna. Los experimentos creados con `experiment_create` ya tienen una, así que para ellos use `targeting_rule_update`. | Ninguno |

## Parámetros

Use los nombres exactos de parámetro que devuelve `tools/list`.

| Herramienta | Parámetros obligatorios | Parámetros opcionales |
| - | - | - |
| `targeting_rule_list` | Ninguno | `siteCode`, `page`, `perPage` |
| `targeting_rule_get` | `targetingRuleId` | Ninguno |
| `targeting_rule_update` | `experimentId` | `targetingRuleId` (opcional; si se indica, debe ser la regla que posee el experimento), `segmentId`, `segmentConfiguration` (`ALL_VISITORS` elimina el segmento), `triggerId`, `triggerConfiguration`, `targetingConfigurationParam`, `confirm` (obligatorio cuando el experimento no está en draft) |
| `targeting_rule_create` | `segmentConfiguration`, `siteCode`, `experimentId` | `segmentId`, `triggerConfiguration`, `triggerId`, `targetingConfigurationParam` |

Para vincular un trigger guardado a un experimento, llame a `targeting_rule_update` con `triggerConfiguration` establecido en `SAVED_TEMPLATE` y `targetingConfigurationParam` establecido en el ID del trigger.

Para vincular un segmento a un experimento, llame a `targeting_rule_update` con `segmentId` y con `segmentConfiguration` establecido en `SAVED_TEMPLATE`. Envíe `segmentId` y `segmentConfiguration` juntos.

**Valores aceptados:** `segmentConfiguration` es `ALL_VISITORS`, `AUTOPROMO_AUTODEFINED`, `GRAPHICAL_PAGES`, `HEAT_SLICE`, `PAGE`, `SAVED_TEMPLATE`, `SITE` o `URL`, y `triggerConfiguration` admite los mismos valores excepto `ALL_VISITORS`. El parámetro `targetingConfigurationParam` es un ID de trigger guardado para `SAVED_TEMPLATE`, un ID de segmento para `HEAT_SLICE`, una URL completa para `PAGE` o un fragmento de URL para `URL`.
