Skip to main content
Glama

Fetch Deploy Logs

tflogs
Read-only

Fetch 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:

  1. First call: tflogs(session_id='...') → get logs + last_event_id

  2. Next call: tflogs(session_id='...', last_event_id='...') → get NEW logs only

  3. Repeat until complete: true in response

RESPONSE FIELDS:

  • logs: Array of log messages collected

  • last_event_id: Pass this back to get more logs (pagination cursor, SSE only)

  • complete: true if job finished, false if more logs may be available

  • total_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

TableJSON Schema
NameRequiredDescriptionDefault
tailNoReturn only the last N log entries. Use 0 (or omit) for all available entries.
job_idNoOptional. Target a specific job. Use tfruns to discover job IDs. When omitted, streams the latest job for the session.
timeoutNoMax seconds to collect logs. Default 50, max 55.
session_idYesSession 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_idNoResume cursor for pagination. Pass back the last_event_id from a previous tflogs response to fetch only newer entries.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description discloses pagination behavior, response fields, and context window warning. Consistent with readOnlyHint and openWorldHint annotations. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with sections for job states, pagination, response fields, and notes. Each sentence adds value, no redundancy.

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?

Complete coverage of two operational modes, pagination, all parameters, and response fields. No output schema, but response fields are described. Contextual warning about log size adds completeness.

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

Parameters5/5

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

Schema coverage is 100%, but the description adds significant value: explains default behavior for job_id, timeout range, last_event_id pagination cursor, and session_id format with token suffix warning.

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?

The description starts with 'MONITORING: Fetch Terraform deployment logs with pagination' and clearly states it fetches logs from running or completed jobs, distinguishing it from sibling tools like tfdeploy or tfruns.

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

Usage Guidelines5/5

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

Explicit guidance on when to use REST vs SSE, pagination steps, use of tail to avoid large context, and prerequisite session_id from convoopen. Clear when-not conditions implied by the different job states.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/luthersystems/insideout-agent-skills'

If you have feedback or need assistance with the MCP directory API, please join our Discord server