Skip to main content
Glama

terraform-cloud-mcp

update_workspace_variable

Update workspace variables in Terraform Cloud by specifying the workspace ID, variable ID, and parameters like key, value, description, category, HCL, or sensitivity. Modify only the specified attributes while leaving others unchanged.

Instructions

Update an existing workspace variable.

Modifies the configuration of an existing workspace variable. Only specified attributes will be updated; unspecified attributes remain unchanged.

API endpoint: PATCH /workspaces/{workspace_id}/vars/{variable_id}

Args: workspace_id: The ID of the workspace (format: "ws-xxxxxxxx") variable_id: The ID of the variable (format: "var-xxxxxxxx")

params: Variable parameters to update (optional): - key: New variable name/key - value: New variable value - description: New description of the variable - category: New variable category ("terraform" or "env") - hcl: Whether the value is HCL code (terraform variables only) - sensitive: Whether the variable value is sensitive

Returns: The updated variable with all current settings and configuration

See: docs/tools/variables.md#update-workspace-variable for reference documentation

Input Schema

NameRequiredDescriptionDefault
paramsNo
variable_idYes
workspace_idYes

Input Schema (JSON Schema)

{ "$defs": { "VariableCategory": { "description": "Variable category options for workspace variables.\n\nDefines the type of variable:\n- TERRAFORM: Terraform input variables available in configuration\n- ENV: Environment variables available during plan/apply operations\n\nReference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/workspace-variables\n\nSee:\n docs/models/variables.md for reference", "enum": [ "terraform", "env" ], "title": "VariableCategory", "type": "string" }, "WorkspaceVariableParams": { "description": "Parameters for workspace variable operations without routing fields.\n\nThis model provides all optional parameters for creating or updating workspace\nvariables, separating configuration parameters from routing information like\nworkspace ID and variable ID.\n\nReference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/workspace-variables\n\nSee:\n docs/models/variables.md for reference", "properties": { "category": { "anyOf": [ { "$ref": "#/$defs/VariableCategory" }, { "type": "null" } ], "default": null, "description": "Variable category (terraform or env)" }, "description": { "anyOf": [ { "maxLength": 512, "type": "string" }, { "type": "null" } ], "default": null, "description": "Description of the variable", "title": "Description" }, "hcl": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "Whether the value is HCL code (only valid for terraform variables)", "title": "Hcl" }, "key": { "anyOf": [ { "maxLength": 255, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Variable name/key", "title": "Key" }, "sensitive": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "Whether the variable value is sensitive", "title": "Sensitive" }, "value": { "anyOf": [ { "maxLength": 256000, "type": "string" }, { "type": "null" } ], "default": null, "description": "Variable value", "title": "Value" } }, "title": "WorkspaceVariableParams", "type": "object" } }, "properties": { "params": { "anyOf": [ { "$ref": "#/$defs/WorkspaceVariableParams" }, { "type": "null" } ], "default": null, "title": "Params" }, "variable_id": { "title": "Variable Id", "type": "string" }, "workspace_id": { "title": "Workspace Id", "type": "string" } }, "required": [ "workspace_id", "variable_id" ], "type": "object" }

Other Tools from terraform-cloud-mcp

Related Tools

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/severity1/terraform-cloud-mcp'

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