Skip to main content

Get SLO status from the CLI and MCP

Read an SLO's compliance and remaining error budget without opening the SLO Center: for scheduled reports, CI/CD checks, or a coding agent. Both options below read the same SLO status the SLO Center shows, over the SLO's own time frame or a custom window, for the whole SLO or one of its permutations, and against its own target or a different one.

From the CX CLI​

Run cx slos status with one or more SLO IDs. Find the IDs with cx slos list.

cx slos status <slo-id> [<slo-id>...] [--last <duration> | --from <time> [--to <time>]] [--grouping-key <label>,<value>]... [--target <percentage>]
OptionDescription
(no window option)Use the SLO's own time frame.
--lastA window ending now, for example 4h. The window ends at the latest minute with data. Can't be combined with --from or --to.
--from, --toA window with a fixed start and an optional end, for example --from now-7d --to now-1d. Times are rounded down to the whole minute.
--grouping-keyNarrow the status to SLO permutations with this grouping label value, as label,value. Repeat it to narrow further.
--targetEvaluate against a different target, from 0 to 100 (for example, 99.9), without changing the SLO.

For each SLO, the command returns its ID and name, the lowest compliance and the lowest remaining error budget across the matching permutations, the window it used, when the status was computed, and whether the window has complete data. Add -o json for structured output: compliance and error budget come as percentages from 0 to 100 (lowest_compliance_percentage, lowest_remaining_error_budget_percentage).

# Status of two SLOs over the last 4 hours, as JSON
cx slos status <slo-id> <slo-id> --last 4h -o json

# One permutation, checked against a 99.9% target
cx slos status <slo-id> --grouping-key service,api --target 99.9

Keep in mind:

  • All or nothing per profile: if any SLO in the command fails, for example an unknown ID, the command prints no report for that profile and names the first SLO that failed.
  • A 0 compliance with a 0 error budget is ambiguous: it means either that every event in the window failed, or that the window had no events for the matching permutations.

The API key needs the SLO:READCONFIG permission. For installation and profiles, see the CX CLI quickstart.

From the MCP server​

The Coralogix MCP server includes the query_slos tool and an slos skill in its slo toolset. Ask your coding agent in plain language, for example What's the remaining error budget of the checkout SLO over the last 4 hours? or Which SLOs are breached? The agent can:

  • List the team's SLOs, worst first, and count them by status, service, team, or environment.
  • Read one SLO's definition with its compliance and remaining error budget, for the whole SLO or one permutation, over a custom window of up to 28 days, or against a different target.
  • List an SLO's permutations, worst first.
  • Find an SLO's own alerts, through the search_alert_definitions tool in the alerts toolset.

Answers lead with status and error budget, and include the PromQL the agent ran, so you can reuse it in a dashboard or alert. Keep in mind:

  • On teams with a very large number of SLOs, finding an SLO by name can fail with a "too many SLOs match" error. Ask the agent to narrow by the SLO's owner service, team, or environment instead.
  • Results don't link to the SLO: open it from the SLO Center to see it in the UI.

query_slos is read-only. To create, edit, or delete SLOs, the agent uses manage_slo_v2s. See MCP server permissions.

Next steps​

Last updated on
Was this page helpful?