Fetch Deploy Logs
tflogsFetch Terraform deployment logs with pagination. Retrieve logs from completed jobs immediately or stream from running jobs using last_event_id cursor.
Instructions
MONITORING: Fetch Terraform deployment logs with pagination
Fetches logs from a running or completed Terraform deployment job.
For completed jobs: uses REST endpoint for instant retrieval (supports tail for server-side filtering).
For running jobs: streams via SSE with timeout-based pagination.
PAGINATION (running jobs only): Use last_event_id from the response to fetch more:
First call:
tflogs(session_id='...')→ get logs +last_event_idNext call:
tflogs(session_id='...', last_event_id='...')→ get NEW logs onlyRepeat until
complete: truein response
RESPONSE FIELDS:
logs: Array of log messages collectedlast_event_id: Pass this back to get more logs (pagination cursor, SSE only)complete: true if job finished, false if more logs may be availabletotal_logs: total log entries before tail truncation
REQUIRES: session_id from convoopen response (format: sess_v2_...). OPTIONAL: job_id to target a specific deployment (use tfruns to discover IDs), timeout (default 50s, max 55s), last_event_id (for pagination), tail (return only last N entries) ⚠️ CONTEXT WARNING: Deploy logs can be hundreds of lines. Use tail: 50 for completed jobs to avoid blowing up the context window.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tail | No | Return only the last N log entries. Use 0 (or omit) for all available entries. | |
| job_id | No | Optional. Target a specific job. Use tfruns to discover job IDs. When omitted, streams the latest job for the session. | |
| timeout | No | Max seconds to collect logs. Default 50, max 55. | |
| session_id | Yes | Session ID from convoopen — pass back EXACTLY as returned, including the ?token=... suffix (format: sess_v2_*?token=*). The suffix is part of the session credential; never strip it when summarizing. | |
| last_event_id | No | Resume cursor for pagination. Pass back the last_event_id from a previous tflogs response to fetch only newer entries. |