Skip to main content
Glama
YawLabs

@yawlabs/aws-mcp

Official
by YawLabs

aws_logs_tail

Read-only

Tail CloudWatch Logs for a log group to fetch recent events as JSON, oldest first, with optional time window and filter pattern.

Instructions

Tail CloudWatch Logs for a log group. Wraps 'aws logs tail' (not the raw FilterLogEvents API) so you get the same server-side time parsing and event-grouping the CLI uses. Returns recent events as JSON, oldest first. At most maxEvents events come back (default 500, ceiling 10000); when the window held more, the OLDEST are dropped so the newest survive, truncated is true, and totalEvents reports how many the window actually held. Does NOT stream -- run once to fetch the window, then call again with a later since. The cap bounds the RESPONSE, not the scan: 'aws logs tail' still drains the whole window server-side, so on a busy group narrow via filterPattern or a smaller since to make the call itself cheaper.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceNoWindow to tail: '<number><s|m|h|d|w>'. Default '10m'. Example: '30m', '1h', '3d'. Must be greater than zero and at most 30 days -- 'aws logs tail' drains the whole window server-side.
regionNoOverride session region for this call.
profileNoOverride session profile for this call.
maxEventsNoMaximum events to return (1-10000). Default 500. Events are returned oldest-first; when the window held more than this, the OLDEST are dropped and the newest kept, with truncated=true and totalEvents naming the full count. Bounds the RESPONSE only -- 'aws logs tail' has already drained the whole window server-side by the time the cap applies, so narrow 'since' or add a 'filterPattern' to make the call itself cheaper.
timeoutMsNoTimeout in milliseconds. Default 60000 (60s). Raise for large windows.
logGroupNameYesLog group name, e.g. '/aws/lambda/my-fn' or '/aws/ecs/my-service' (no leading 'logs/'). A full log-group ARN ('arn:aws:logs:us-east-1:123456789012:log-group:/aws/lambda/my-fn', with or without a trailing ':*') is also accepted -- the group name is extracted from it.
filterPatternNoCloudWatch Logs filter pattern. E.g. 'ERROR', '"stack trace"', '[timestamp, request_id, level = ERROR, ...]'.
logStreamNamesNoRestrict to specific stream names. Overrides the default (all streams in the group).
logStreamNamePrefixNoRestrict to streams with this prefix. Mutually exclusive with logStreamNames.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.2.2
    • addedInput schema / properties / maxEvents
      Added value: +{
      +  "description": "Maximum events to return (1-10000). Default 500. Events are returned oldest-first; when the window held more than this, the OLDEST are dropped and the newest kept, with truncated=true and totalEvents naming the full count. Bounds the RESPONSE only -- 'aws logs tail' has already drained the whole window server-side by the time the cap applies, so narrow 'since' or add a 'filterPattern' to make the call itself cheaper.",
      +  "exclusiveMinimum": 0,
      +  "maximum": 10000,
      +  "type": "integer"
      +}
  2. Changed2 schema fields changedv2.1.0
    • changedInput schema / properties / logGroupName / description
      Previous value: -"Log group name, e.g. '/aws/lambda/my-fn' or '/aws/ecs/my-service'. No leading 'logs/'."New value: +"Log group name, e.g. '/aws/lambda/my-fn' or '/aws/ecs/my-service' (no leading 'logs/'). A full log-group ARN ('arn:aws:logs:us-east-1:123456789012:log-group:/aws/lambda/my-fn', with or without a trailing ':*') is also accepted -- the group name is extracted from it."
    • changedInput schema / properties / since / description
      Previous value: -"Window to tail: '<number><s|m|h|d|w>'. Default '10m'. Example: '30m', '1h', '3d'."New value: +"Window to tail: '<number><s|m|h|d|w>'. Default '10m'. Example: '30m', '1h', '3d'. Must be greater than zero and at most 30 days -- 'aws logs tail' drains the whole window server-side."
  3. First observedv1.3.2

TDQS

A4.4/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, non-idempotent), but the description adds genuinely non-obvious behavior: truncation drops the OLDEST events, sets truncated=true and reports totalEvents; the maxEvents cap bounds the RESPONSE while the CLI still drains the whole window server-side, with cost implications. This is exactly the kind of context annotations cannot express.

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, then returns, then truncation semantics, then cost guidance -- a logical order with no filler sentences. It is dense and somewhat repetitive with the schema on maxEvents/truncation, which keeps it short of a perfect score.

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?

Despite no output schema, the description fully specifies the return shape (JSON, oldest-first, cap behavior, truncated flag, totalEvents count) and the non-streaming call pattern. Nothing an agent needs to invoke this correctly or interpret the result is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter including since, maxEvents, and logGroupName is already documented in-schema (the ARN acceptance, pattern format, mutual exclusivity of stream filters). The description's maxEvents/since explanation largely restates the schema text, so the baseline 3 is appropriate.

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?

Specific verb+resource ('Tail CloudWatch Logs for a log group') with an explicit scope statement distinguishing it from the raw FilterLogEvents API and clarifying it mirrors the CLI's parsing/grouping. An agent can tell it apart from sibling aws_logs_query without opening either schema.

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

Usage Guidelines4/5

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

Gives clear operational context: 'Does NOT stream -- run once to fetch the window, then call again with a later since', and advises narrowing via filterPattern or smaller since on busy groups. It does not, however, explicitly name the alternative sibling (aws_logs_query) or state when to prefer it, so the routing guidance is implicit rather than complete.

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