Setting the file. One moment.
Subchapter 43.2
logs.mdMarkdown3 KBView on GitHub
Load this file when the investigation touches application logs — error messages, log-level filters, service log patterns.
Logs are your best tool for verbatim evidence. They’re your worst tool for “what’s the overall picture” — reach for query-aggregations instead.
The query-logs tool returns paginated log entries with timestamp, level, message, and core attributes.
start_date is required; ISO format with timezone (e.g. 2026-01-24T15:25:19.000-08:00 or 2026-01-24T15:25:19Z).end_date defaults to now.query is a filter expression like message="error" AND level=error. Empty string returns all logs in range. See query syntax below.limit defaults to 20, max 50. Do not request more.direction is ASC or DESC. Defaults to DESC (newest first).Session-scoped queries. To pull logs from a specific session, use secure_session_id=<id> in the query. Set start_date to the session’s created_at and end_date to created_at + 3 hours. Narrower windows will miss tail events.
query="level=error AND service_name=<svc>", 24h window, aggregate first with query-aggregations if volume is high.query="message=\"Cannot use 'in' operator*\"". Wildcards work.query="trace_id=<id>" with a 1-minute window centered on the event.query-aggregations with product_type="logs" and group_by="level" for a time window, then drill into high-count levels with query-logs.{"ts": "2026-04-20T14:23:11Z", "level": "error", "message": "pg_pool: connection timeout after 30s"} is.query-flag-evaluations when a regression appears.query-aggregations for aggregates.start_date. It’s required.message="*") — returns everything, wastes token budget.get-keys(product_type="Logs") if you’re unsure which field to filter on.