# Service level objectives

Manage [Coralogix service level objectives](https://coralogix.com/docs/user-guides/slos/introduction/index.md) directly from your AI agent. The Model Context Protocol (MCP) server provides a unified tool to create, retrieve, update, and delete service level objective v2 resources, and to generate infrastructure-as-code definitions from their configurations.

## Tool

Use `manage_slo_v2s` for all service level objective operations.

| Action value          | Description                                                                                                                                                                                           |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `create`              | Create a new service level objective v2 resource.                                                                                                                                                     |
| `get`                 | Retrieve a specific resource by ID.                                                                                                                                                                   |
| `list`                | List resources with an optional case-insensitive name filter.                                                                                                                                         |
| `update`              | Update an existing resource. The agent retrieves the current configuration first, then applies your changes.                                                                                          |
| `delete`              | Delete a resource by ID.                                                                                                                                                                              |
| `generate_openapi`    | Generate the OpenAPI JSON payload for use with the Coralogix REST API.                                                                                                                                |
| `generate_kubernetes` | Generate a Kubernetes Operator YAML manifest for the [Coralogix Operator](https://coralogix.com/docs/developer-portal/infrastructure-as-code/coralogix-operator/index.md).                            |
| `generate_terraform`  | Generate Terraform configuration for the [Coralogix Terraform Provider](https://coralogix.com/docs/developer-portal/infrastructure-as-code/terraform-provider/coralogix-terraform-provider/index.md). |

## Supported shape

The tool supports request-based and window-based metric service level indicators. Supported time frames are 7, 14, 21, and 28 days. Window-based resources support 1-minute and 5-minute windows, with greater-than, less-than, greater-than-or-equal, and less-than-or-equal comparison operators.

## Example prompts

### Create a request-based objective

```text
Create a request-based service level objective v2 named api-availability.
Use target threshold 99, time frame 7 days, good events query
sum(rate(cx_logs_count_total[1m])), and total events query
sum(rate(cx_logs_count_total[1m])).
```

### Create a window-based objective

```text
Create a window-based service level objective v2 named api-window-health.
Use target threshold 95, time frame 7 days, query
avg(rate(cx_logs_count_total[1m])), window 1 minute, comparison operator
greater than or equals, and threshold 0.
```

### Generate Terraform configuration

```text
Generate Terraform configuration for a request-based service level objective v2 named
api-availability-preview with target threshold 99 and time frame 14 days.
Do not create it.
```

## Important behaviors

- **Use 1 service level indicator type.** A resource must be request-based or window-based, not both.
- **Target thresholds must be valid percentages.** The tool rejects values outside the supported range.
- **Use supported time frames and windows.** The tool rejects values outside the shared infrastructure-as-code subset.
- **Update requires retrieval first.** Retrieve the current resource, modify it, then update with the complete definition.
