Skip to main content
Glama

Check Infrastructure Drift

tfdrift
Idempotent

DRIFT CHECK: Run a read-only drift detection check Checks whether deployed infrastructure has drifted from the expected Terraform state. This is a read-only operation — it does NOT modify any infrastructure. Returns job_id. Use tflogs to stream the drift check results. SINGLE-FLIGHT: only one TF job per session at a time. If another job is already in flight, tfdrift returns tf_job_conflict with the live job_id — attach with tfstatus/tflogs, or pass force_new=true to override. REQUIRES: session_id from convoopen response (format: sess_v2_...). PREREQUISITE: The session must have a prior deployment with a project_id. OPTIONAL: force_new (boolean, default false) - bypass the single-flight guard. Use only when the existing run is provably wedged. If drift is detected, the user can either fix the drift or use tfdeploy(ignore_drift=true) to proceed.

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": "tfdrift"
  }
}

Input Schema

NameRequiredDescriptionDefault
force_newNoWhen true, bypass the single-flight guard and force a new drift check even if another job is in flight.
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.

Output Schema

NameRequiredDescriptionDefault
hintsNoGuidance for the calling agent: what to do next and which tools relate to this result.
job_idNoID of the started job. Pass it to tfstatus or tflogs to follow progress. May be empty when the backend did not return one.
successNoTrue when the drift check job was started.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "hints": {
      +      "description": "Guidance for the calling agent: what to do next and which tools relate to this result.",
      +      "properties": {
      +        "next_actions": {
      +          "description": "Suggested next steps, in order, often as ready-to-run tool calls.",
      +          "items": {
      +            "description": "One suggested next step.",
      +            "type": "string"
      +          },
      +          "type": [
      +            "null",
      +            "array"
      +          ]
      +        },
      +        "related_tools": {
      +          "description": "Names of tools that are useful after this result.",
      +          "items": {
      +            "description": "A tool name.",
      +            "type": "string"
      +          },
      +          "type": [
      +            "null",
      +            "array"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "null",
      +        "object"
      +      ]
      +    },
      +    "job_id": {
      +      "description": "ID of the started job. Pass it to tfstatus or tflogs to follow progress. May be empty when the backend did not return one.",
      +      "type": "string"
      +    },
      +    "success": {
      +      "description": "True when the drift check job was started.",
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / force_new / description
      Added value: +"When true, bypass the single-flight guard and force a new drift check even if another job is in flight."
    • addedInput schema / properties / session_id / description
      Added value: +"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."
    • addedInput schema / properties / session_id / pattern
      Added value: +"^sess_v2_[0-9A-Za-z]+\\?token=[0-9a-f]+$"
  3. First observed

TDQS

A4/5.0
Behavior1/5

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

The description asserts twice that this is a read-only operation ('read-only drift detection check', 'it does NOT modify any infrastructure'), yet the annotations declare readOnlyHint=false. An agent receiving these two signals would be genuinely unsure whether invoking this tool can mutate state, which is exactly the kind of conflict the rubric penalizes. Annotation Contradiction.

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

Conciseness4/5

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

Well-structured with labeled sections (DRIFT CHECK, SINGLE-FLIGHT, REQUIRES, PREREQUISITE, OPTIONAL) and the core purpose is front-loaded. It runs long, but nearly every line carries operational information an agent needs (conflict handling, credential format, prerequisite).

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?

An output schema exists so the return value needn't be explained, yet the description still tells the agent it returns job_id and to stream results with tflogs. Combined with the single-flight guard, session format, project_id prerequisite, and override escape hatch, nothing needed to call this correctly is missing.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, but the description adds real meaning: it explains force_new as bypassing the single-flight guard and constrains its use ('use only when the existing run is provably wedged'), and it reinforces the session_id format/credential requirement beyond the schema text.

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?

States a specific verb+resource ('Run a read-only drift detection check') and scopes it precisely ('checks whether deployed infrastructure has drifted from the expected Terraform state'). It is clearly distinguishable from sibling tools like tfdeploy, tflogs, and tfstatus, which it names directly.

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?

Explicitly routes the agent: 'Use tflogs to stream the drift check results', and on conflict 'attach with tfstatus/tflogs, or pass force_new=true'. It also gives a when-not for force_new ('Use only when the existing run is provably wedged') and names tfdeploy(ignore_drift=true) as the downstream alternative when drift is found.

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.

Resources