Fetch Deploy Logs
tflogsMONITORING: 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.
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": {
"session_id": "<session_id>"
},
"name": "tflogs"
}
}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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logs | No | Log lines, oldest first. | |
| hints | No | Guidance for the calling agent: what to do next and which tools relate to this result. | |
| complete | No | True when the job has finished and no more logs will come. | |
| logs_count | No | Number of log lines in this result. | |
| session_id | No | Session ID these logs belong to. | |
| last_event_id | No | Log cursor. Pass it back as last_event_id to fetch only newer entries. |