Skip to main content
Glama

Fetch Deploy Logs

tflogs
Read-only

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.

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses REST vs SSE streaming, pagination with last_event_id, response field meanings, and a context window warning. This is rich behavioral detail that helps the agent understand side effects and limitations.

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?

The description is organized with clear sections (MONITORING, PAGINATION, RESPONSE FIELDS, REQUIRES/OPTIONAL) and front-loaded with a summary. Every sentence adds value without fluff, making it easy to parse despite its length.

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?

With no output schema, the description fully explains the response fields (logs, last_event_id, complete, total_logs) and provides a step-by-step pagination algorithm. It also warns about context-window risk. This is complete for an agent to use correctly.

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 description coverage is 100%, but the description adds critical semantics: the session_id token suffix warning ('never strip it when summarizing'), tail for context, and pagination cursor behavior. This goes well beyond the schema descriptions.

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 clearly states 'Fetch Terraform deployment logs' with a specific verb and resource. It differentiates between running and completed jobs and mentions pagination, making it distinct from sibling tools like tfstatus 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 Guidelines4/5

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

The description provides explicit usage context: requires session_id from convoopen, optional job_id discoverable via tfruns, and detailed pagination steps. It does not explicitly say 'when not to use this tool', but the instructions are clear and reference alternatives.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose, with clear domain prefixes (convo*, tf*, stack*, aws/gcp inspect) separating conversation, deployment, versioning, and cloud inspection. The batch variants (awsinspect_batch, gcpinspect_batch) are explicitly scoped as higher-throughput versions of their singular counterparts, so no ambiguity exists.

Naming Consistency4/5

The naming is mostly consistent: lowercase concatenated verb_noun patterns dominate (convoopen, tfdeploy, stackrollback, awsinspect). However, submit_feedback uses snake_case, and help stands alone as a generic utility, breaking the otherwise uniform lowercase-concatenated style.

Tool Count4/5

24 tools is on the heavier side, but the count is justified by the breadth of the domain: conversation workflow, multi-cloud inspection, Terraform lifecycle, stack versioning, and utilities. Each tool fills a distinct role, so while slightly high, the count is not bloated.

Completeness5/5

The tool surface covers the full infrastructure lifecycle: conversation and design (convoopen/convoreply/convostatus), Terraform generation and deployment (tfgenerate/tfplan/tfdeploy), monitoring (tfstatus/tflogs), teardown (tfdestroy), drift detection, stack versioning, and cloud inspection. No critical dead ends; only a missing explicit cancel/abort for running jobs is a minor gap.

Resources