Skip to content

M3-4: Container Log Retrieval

Description

Create get_container_logs tool with standardized pagination support.

Endpoint

POST /api/v1/tools/get_container_logs

Parameters

  • container_name (string): Container name
  • lines (number): Number of lines (default: 1000, max: 5000)
  • offset (number): Line offset for pagination
  • after (string): RFC3339 timestamp to get logs after
  • before (string): RFC3339 timestamp to get logs before
  • tail (boolean): Read from end backwards
  • timestamps (boolean): Include timestamps (default: true)

Pagination Behavior

  • Standard mode: Read forward from offset
  • Tail mode: Read backward from end
  • With timestamps: Filter within time range
  • Response includes log_entries array, metadata, pagination info

Timeout Protection

  • Default timeout: 10 seconds
  • Return partial results if timeout exceeded
  • Include timeout status in response

Estimated Effort

1.5 days