Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fuser-guides%2Fmcp-server%2Ftools%2Ftco-log-policies.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fuser-guides%2Fmcp-server%2Ftools%2Ftco-log-policies.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# Total Cost Optimization log policies

Manage [Coralogix Total Cost Optimization (TCO) Optimizer](https://docs-docusaurus.kinsta.page/user-guides/account-management/tco-optimizer/.md) log policies directly from your AI agent. The Model Context Protocol (MCP) server provides a unified tool to create, retrieve, update, and delete log policies, and to generate infrastructure-as-code definitions.

## Tool[​](#tool "Direct link to Tool")

Use `manage_tco_log_policies` for all log policy operations.

| Action value          | Description                                                                |
| --------------------- | -------------------------------------------------------------------------- |
| `create`              | Create a log policy.                                                       |
| `get`                 | Retrieve a specific log policy by ID.                                      |
| `list`                | List log policies with an optional case-insensitive name filter.           |
| `update`              | Update an existing policy.                                                 |
| `delete`              | Delete a log policy by ID.                                                 |
| `generate_openapi`    | Generate the OpenAPI JSON payload for an atomic overwrite request.         |
| `generate_kubernetes` | Generate a Kubernetes Operator YAML manifest for the full log policy list. |
| `generate_terraform`  | Generate Terraform configuration for the full log policy list.             |

## Example prompts[​](#example-prompts "Direct link to Example prompts")

### Create a policy[​](#create-a-policy "Direct link to Create a policy")

```
Create a Total Cost Optimization log policy named low-priority-backend-errors.

Enable it, set priority low, match severities error and critical, match

applications that start with mcp-beta, and match subsystems that include backend.
```

### Export 1 policy[​](#export-1-policy "Direct link to Export 1 policy")

```
Generate Terraform configuration for the Total Cost Optimization log policy named

low-priority-backend-errors. Do not apply it.
```

### Export the full policy list[​](#export-the-full-policy-list "Direct link to Export the full policy list")

```
Generate Terraform configuration and Kubernetes YAML for the full current Total Cost

Optimization log policy list. This is inspect-only; do not apply the output.
```

## Important behaviors[​](#important-behaviors "Direct link to Important behaviors")

* **Generated Terraform and Kubernetes are atomic overwrite resources.** Applying generated output replaces the complete backend log policy set.
* **Prefer full-list generation.** The tool allows single-policy generation, but returns a warning because the generated resource represents the full list.
* **Priority and severity values must be valid.** The tool rejects invalid values before it sends the request.
* **Archive retention output needs a resolvable retention name.** Provide it when generating Kubernetes YAML for archive-retention policies.
