Skip to main content
Glama
terrakube-io

Terrakube MCP Server

by terrakube-io

edit-variable

Modify details of an existing variable in Terrakube MCP Server, including key, value, category, and sensitivity, to ensure accurate infrastructure configuration.

Instructions

Updates an existing variable's details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoNew variable category
descriptionNoNew variable description
keyNoNew variable key
organizationIdYesOrganization ID
sensitiveNoNew sensitive flag
valueNoNew variable value
variableIdYesVariable ID
workspaceIdYesWorkspace ID

Implementation Reference

  • Handler function that performs a PATCH request to the Terraform Cloud API to update the variable's attributes (key, value, description, category, sensitive). Returns success message on 204 or throws error.
    async ({ organizationId, workspaceId, variableId, key, value, description, category, sensitive }) => {
      const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/workspace/${workspaceId}/variable/${variableId}`, {
        method: "PATCH",
        headers: {
          Authorization: `Bearer ${CONFIG.patToken}`,
          "Content-Type": "application/vnd.api+json"
        },
        body: JSON.stringify({
          data: {
            type: "variable",
            id: variableId,
            attributes: {
              key,
              value,
              description,
              category,
              sensitive
            }
          }
        })
      });
    
      if (response.status === 204) {
        return {
          content: [{
            type: "text",
            text: "Variable updated successfully"
          }]
        };
      } else {
        throw new Error(`Failed to update variable: ${response.statusText}`);
      }
    }
  • Zod input schema for the edit-variable tool, requiring organizationId, workspaceId, variableId, and allowing optional updates to key, value, description, category, sensitive.
    {
      organizationId: z.string().describe("Organization ID"),
      workspaceId: z.string().describe("Workspace ID"),
      variableId: z.string().describe("Variable ID"),
      key: z.string().optional().describe("New variable key"),
      value: z.string().optional().describe("New variable value"),
      description: z.string().optional().describe("New variable description"),
      category: z.string().optional().describe("New variable category"),
      sensitive: z.boolean().optional().describe("New sensitive flag")
    },
  • Registration of the 'edit-variable' tool on the MCP server within the registerVariableTools function, specifying name, description, input schema, and handler implementation.
    server.tool(
      "edit-variable",
      "Updates an existing variable's details",
      {
        organizationId: z.string().describe("Organization ID"),
        workspaceId: z.string().describe("Workspace ID"),
        variableId: z.string().describe("Variable ID"),
        key: z.string().optional().describe("New variable key"),
        value: z.string().optional().describe("New variable value"),
        description: z.string().optional().describe("New variable description"),
        category: z.string().optional().describe("New variable category"),
        sensitive: z.boolean().optional().describe("New sensitive flag")
      },
      async ({ organizationId, workspaceId, variableId, key, value, description, category, sensitive }) => {
        const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/workspace/${workspaceId}/variable/${variableId}`, {
          method: "PATCH",
          headers: {
            Authorization: `Bearer ${CONFIG.patToken}`,
            "Content-Type": "application/vnd.api+json"
          },
          body: JSON.stringify({
            data: {
              type: "variable",
              id: variableId,
              attributes: {
                key,
                value,
                description,
                category,
                sensitive
              }
            }
          })
        });
    
        if (response.status === 204) {
          return {
            content: [{
              type: "text",
              text: "Variable updated successfully"
            }]
          };
        } else {
          throw new Error(`Failed to update variable: ${response.statusText}`);
        }
      }
    );
Behavior2/5

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

With no annotations, the description carries full burden but only states it's an update operation. It lacks critical behavioral details: whether it requires specific permissions, if changes are reversible, rate limits, or what happens to unspecified fields (partial vs. full updates). This is inadequate for a mutation tool with zero annotation coverage.

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 a single, efficient sentence with no wasted words. It's front-loaded and directly states the tool's purpose, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 8 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain behavioral traits, error conditions, or return values, leaving significant gaps in understanding how to use the tool effectively.

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

Parameters3/5

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

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds no additional meaning beyond implying 'details' correspond to the schema fields, meeting the baseline for high coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Updates an existing variable's details' clearly states the action (updates) and resource (variable), distinguishing it from sibling tools like create-variable or get-variable. However, it doesn't specify what 'details' encompass beyond the general concept, leaving some ambiguity compared to more precise alternatives.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., variable must exist), exclusions, or comparisons to siblings like edit-workspace, leaving the agent to infer usage from the name and schema alone.

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

Related 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/terrakube-io/mcp-server-terrakube'

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