Skip to main content
Glama
Rootly MCP server

Rootly MCP server

Official
by rootlyhq

Count Observability Logs

count_observability_logs
Read-only

Counts logs matching a Logs explorer query and groups results by service, index, severity, or attribute key to answer questions such as errors per service in a time window.

Instructions

Count logs matching a Logs explorer query, grouped by service, index, severity or an attribute key (@http.status_code). Answers questions like "errors per service in the last 6h" (filter[query]=severity:error, filter[from]=now-6h, group_by=service). Values are ordered by count, largest first; meta.total counts every matching log, and each value's logs_query drills into its rows with GET /v1/observability/logs (null for a blank value, which the query syntax cannot select, or when the drill-down would exceed the query limits: 512 characters or 20 clauses). A log can carry an attribute key more than once (log, resource and scope attributes), so attribute counts can add up to more than meta.total; when logs match but none have the attribute, data is empty and meta.warnings has code attribute_missing. Requires a personal or Global API key (Team API Keys are group-scoped and get 403 unsupported_api_key) or an OAuth token with the obs.logs:read (or all) scope, and the Observability logs read permission. A Global API key uses its service user's Observability role, which starts as the team's default Observability role. Limited to 60 requests per minute per token; on this endpoint the X-RateLimit-* headers report that per-minute budget, not the default API limit. Every 429 returns the errors envelope with code rate_limited and a Retry-After header.

Input Schema

NameRequiredDescriptionDefault
group_byNoField to group by: `service`, `index`, `severity`, or `@` followed by an attribute key (e.g. `@http.status_code`). Defaults to `service`. Secret-shaped attribute keys (password, token, auth, cookie, session, ...) are rejected with `invalid_parameter`. Secret-shaped values are returned redacted with `logs_query: null`.service
filter_toNoWindow end: ISO8601 or relative like `now`. Defaults to `now`.
page_sizeNoNumber of top values to return (1-100, default 25). Not paginated: meta.truncated is true when more values matched.
filter_fromNoWindow start: ISO8601 or relative like `now-6h`, `now-30m`, `now-2d`. Defaults to `now-1h`. Windows are at most 7 days, and 24 hours without an indexable term.
filter_queryNoLogs explorer query, e.g. `severity:error index:main`.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.4.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds substantial behavior beyond the readOnly/openWorld annotations: authentication requirements, OAuth scope, permission model, 60 requests/minute limit, 429 rate_limited envelope, Retry-After header, attribute multiplicity, attribute_missing warnings, and drill-down null conditions. This is unusually complete for a read-only analytics endpoint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose and a concrete example, then layers operational details. It is dense and long, but nearly every sentence carries useful behavioral or constraint information for a complex endpoint.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema and annotations, the description covers the remaining gaps an agent needs: auth, rate limits, grouping behavior, drill-down semantics, warnings, and query limits. Nothing material appears missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all five parameters. The description still adds useful semantics: group_by examples including attribute keys, filter query examples, and the meaning of meta.total versus per-value counts. It does not need to repeat every schema detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: count logs matching a Logs explorer query, grouped by service, index, severity, or attribute key. It clearly distinguishes aggregation from row retrieval by explaining that each value's logs_query drills into rows via GET /v1/observability/logs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a concrete usage example ('errors per service in the last 6h') with the exact filter and group_by parameters. It also explains the alternative drill-down path for raw rows, making the count-vs-list distinction explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools