Skip to main content
Glama
Scalyr MCP Server

Scalyr MCP Server

by celos101

scalyr_query_logs

Read-only

Search Scalyr/DataSet logs with filters and automatic pagination to retrieve matching events, timestamps, messages, and parsed attributes within a specified time range.

Instructions

Search Scalyr/DataSet logs with automatic pagination. Returns matching log events with timestamps, messages, and parsed attributes.

Recommended workflow: use scalyr_facets or scalyr_count first to understand the data volume, then use this tool with a targeted filter and small maxCount.

Filter syntax examples:

  • $serverHost == "myserver" level == "ERROR"

  • $serverHost == "bank-cron" (level == "ERROR" || level == "CRITICAL")

  • $logfile == "/var/log/app.log" status >= 500

Tips:

  • Use a narrow time range and specific filters to avoid scanning too much data.

  • The API scans forward from startTime — if most logs are INFO, errors near the end of the range may not be reached with low priority. Use priority "high" or a narrower time window.

  • Start with maxCount 20-50 to preview results before requesting more.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "filter": "<filter>",
      "startTime": "<startTime>"
    },
    "name": "scalyr_query_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
filterYesScalyr filter expression, e.g. '$serverHost == "myserver" level == "ERROR"'
endTimeNoEnd of time range. Defaults to now
maxCountNoMaximum log events to return. Start small (20-50) to preview, increase if needed. Default 100, max 5000
maxPagesNoMaximum pagination requests (default 10). Increase only if you need a large result set
priorityNoScanning budget. 'low' is cheapest but may miss events in large time ranges. Use 'high' for thorough searcheslow
startTimeYesStart of time range. Relative (e.g. '60m', '24h', '7d') or absolute timestamp

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, openWorld, non-destructive), and the description adds non-obvious behavior on top: automatic pagination, forward-only scanning from startTime, and the risk of missing late-range events under low priority. That scanning caveat is exactly the kind of operational nuance structured fields cannot convey.

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?

Front-loaded with purpose and workflow, then bulleted examples and tips, so the agent gets the essentials first. A few lines restate schema text verbatim (maxCount 20-50, priority semantics), which is the only wasted space.

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

Completeness4/5

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

No output schema exists, yet the description still characterizes the return payload, and the query/pagination semantics are covered for a fairly complex tool. The remaining gap is what happens when maxPages is exhausted — whether results are silently truncated or flagged as incomplete is never stated.

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 baseline is 3, and the description earns above baseline by showing three concrete, multi-clause filter expressions (boolean groups, string equality, numeric comparison) that go well beyond the schema's single example. It is partly redundant, though: the maxCount guidance ("start with 20-50") and the priority tradeoff are already written into the schema property descriptions.

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 ("Search Scalyr/DataSet logs") plus the pagination behavior and the shape of the return ("timestamps, messages, and parsed attributes"). The recommended workflow naming scalyr_facets and scalyr_count makes the boundary with siblings explicit.

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?

Explicitly routes the agent: use scalyr_facets or scalyr_count first to size the data, then call this with a targeted filter and small maxCount. It also names conditions where the tool misbehaves (INFO-heavy ranges hiding late errors) and prescribes the fix (priority "high" or narrower window).

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