Skip to main content
Glama
terrakube-io

Terrakube MCP Server

by terrakube-io

create-variable

Add a new variable to a specified workspace in Terrakube MCP Server. Define key, value, category, and sensitivity to manage infrastructure configurations effectively.

Instructions

Creates a new variable in the specified workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoVariable category (e.g., terraform, environment)
descriptionNoVariable description
keyYesVariable key
organizationIdYesOrganization ID
sensitiveNoWhether the variable is sensitive
valueYesVariable value
workspaceIdYesWorkspace ID

Implementation Reference

  • The async handler function that executes the 'create-variable' tool logic by sending a POST request to create a new variable in the Terrakube workspace.
    async ({ organizationId, workspaceId, key, value, description, category, sensitive }) => {
      const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/workspace/${workspaceId}/variable`, {
        method: "POST",
        headers: {
          Authorization: `Bearer ${CONFIG.patToken}`,
          "Content-Type": "application/vnd.api+json"
        },
        body: JSON.stringify({
          data: {
            type: "variable",
            attributes: {
              key,
              value,
              description,
              category,
              sensitive
            }
          }
        })
      });
    
      if (!response.ok) {
        throw new Error(`Failed to create variable: ${response.statusText}`);
      }
    
      const data = await response.json();
      return {
        content: [{
          type: "text",
          text: JSON.stringify(data, null, 2)
        }]
      };
    }
  • Zod schema defining the input parameters for the 'create-variable' tool.
    {
      organizationId: z.string().describe("Organization ID"),
      workspaceId: z.string().describe("Workspace ID"),
      key: z.string().describe("Variable key"),
      value: z.string().describe("Variable value"),
      description: z.string().optional().describe("Variable description"),
      category: z.string().optional().describe("Variable category (e.g., terraform, environment)"),
      sensitive: z.boolean().optional().describe("Whether the variable is sensitive")
    },
  • The server.tool() call that registers the 'create-variable' tool on the MCP server, specifying name, description, input schema, and handler function.
    server.tool(
      "create-variable",
      "Creates a new variable in the specified workspace",
      {
        organizationId: z.string().describe("Organization ID"),
        workspaceId: z.string().describe("Workspace ID"),
        key: z.string().describe("Variable key"),
        value: z.string().describe("Variable value"),
        description: z.string().optional().describe("Variable description"),
        category: z.string().optional().describe("Variable category (e.g., terraform, environment)"),
        sensitive: z.boolean().optional().describe("Whether the variable is sensitive")
      },
      async ({ organizationId, workspaceId, key, value, description, category, sensitive }) => {
        const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/workspace/${workspaceId}/variable`, {
          method: "POST",
          headers: {
            Authorization: `Bearer ${CONFIG.patToken}`,
            "Content-Type": "application/vnd.api+json"
          },
          body: JSON.stringify({
            data: {
              type: "variable",
              attributes: {
                key,
                value,
                description,
                category,
                sensitive
              }
            }
          })
        });
    
        if (!response.ok) {
          throw new Error(`Failed to create variable: ${response.statusText}`);
        }
    
        const data = await response.json();
        return {
          content: [{
            type: "text",
            text: JSON.stringify(data, null, 2)
          }]
        };
      }
    );
  • src/index.ts:25-25 (registration)
    Call to registerVariableTools which includes the 'create-variable' tool registration on the main MCP server instance.
    registerVariableTools(server);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'creates' implies a write operation, it doesn't specify permissions required, whether the operation is idempotent, what happens on duplicate keys, or what the response contains. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 that communicates the core purpose without unnecessary words. It's appropriately sized for a tool with good schema documentation and gets straight to the point.

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 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens after creation, error conditions, or how this tool relates to sibling tools. The agent would need to infer too much from the minimal description.

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?

The schema description coverage is 100%, providing complete parameter documentation. The description adds no additional parameter information beyond what's already in the schema, so it meets the baseline expectation but doesn't enhance understanding of parameter meanings or relationships.

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 clearly states the action ('creates') and resource ('new variable in the specified workspace'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'edit-variable' or explain how creation differs from editing, which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'edit-variable' or 'get-variable'. It also doesn't mention prerequisites, such as needing an existing workspace or organization, or when variable creation is appropriate versus other operations.

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