Skip to main content
Glama

terraform-cloud-mcp

update_variable_in_variable_set

Modify specific attributes of a variable within a Terraform Cloud variable set. Update the name, value, description, category, HCL status, or sensitivity without altering unspecified settings. Ensure precise configuration changes via the PATCH API endpoint.

Instructions

Update an existing variable in a variable set.

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

API endpoint: PATCH /varsets/{varset_id}/relationships/vars/{var_id}

Args: varset_id: The ID of the variable set (format: "varset-xxxxxxxx") var_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-variable-in-variable-set for reference documentation

Input Schema

NameRequiredDescriptionDefault
paramsNo
var_idYes
varset_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" }, "VariableSetVariableParams": { "description": "Parameters for variable set variable operations without routing fields.\n\nThis model provides all optional parameters for creating or updating variables\nwithin variable sets, separating configuration parameters from routing information\nlike variable set ID and variable ID.\n\nReference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/variable-sets\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": "VariableSetVariableParams", "type": "object" } }, "properties": { "params": { "anyOf": [ { "$ref": "#/$defs/VariableSetVariableParams" }, { "type": "null" } ], "default": null, "title": "Params" }, "var_id": { "title": "Var Id", "type": "string" }, "varset_id": { "title": "Varset Id", "type": "string" } }, "required": [ "varset_id", "var_id" ], "type": "object" }

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