Skip to main content
Glama

Set environment variables

set_variables
DestructiveIdempotent

Saves plain variable values such as baseUrl or userId to a workspace environment file for later requests and app use, while refusing credentials and secret-marked variables.

Instructions

Save plain variable values such as baseUrl or userId in an environment file of the workspace, so later requests and the developer's app use them. Credentials are refused, and so are variables the developer marked secret. Values set here never let requests reach a new host. Refused when the environment changed since list_environments showed it.

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": {
      "variables": "<variables>"
    },
    "name": "set_variables"
  }
}

Input Schema

NameRequiredDescriptionDefault
revisionNoThe revision you last read (from get_request, list_environments or a save). The save is refused if the item has changed since. Leave out to use the one this session last saw.
variablesYesNames and plain values, such as {"baseUrl": "http://localhost:8080"}. Credentials are refused; the developer sets those in the app or with --var-from-env.
environmentNoThe environment to change, as list_environments shows it. Defaults to the active one. A name that does not exist yet creates that environment.

Output Schema

NameRequiredDescriptionDefault
setNo
noteNo
activeNo
createdNo
revisionNo
environmentNo
overriddenByCommandLineNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.16.1
    • addedInput schema / properties / revision
      Added value: +{
      +  "description": "The revision you last read (from get_request, list_environments or a save). The save is refused if the item has changed since. Leave out to use the one this session last saw.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / revision
      Added value: +{
      +  "type": "string"
      +}
  2. First observedv1.7.19

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and openWorldHint=false, so the safety profile is partly covered; the description adds real value on top with refusal rules (credentials, developer-marked secrets) and the security guarantee that values set here never let requests reach a new host. The notable omission is overwrite semantics: it does not say whether existing variables are merged or replaced, which matters for a destructive tool.

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?

Four short sentences, each carrying distinct information: purpose, acceptance rules, security boundary, and concurrency refusal. Constraints are front-loaded and nothing is padding, with only slight overlap between the description's credential note and the schema's.

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

Completeness4/5

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

With an output schema present, return values need no explanation, and the description adequately covers acceptance rules, concurrency behavior and host-scope safety. For a tool flagged destructive, the missing piece is what happens to variables the caller does not list in the variables object.

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 coverage is 100%, so the baseline is 3, and the description earns above that by reinforcing the variables parameter's constraint (plain values only, credentials refused) and by tying the revision parameter to the change-detection refusal against list_environments. It still adds no syntax or format guidance beyond what the schema already supplies.

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 names a specific verb and resource: saving plain variable values into a workspace environment file, with examples (baseUrl, userId) and a downstream purpose (later requests and the developer's app). It distinguishes itself from a credential store by refusing credentials and developer-marked secrets. It does not explicitly contrast with set_environment, so sibling differentiation is only partial.

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

Usage Guidelines4/5

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

It gives clear preconditions and refusal conditions: credentials are rejected, secret-marked variables are rejected, and the save fails if the environment changed since list_environments showed it. That is a usable when/when-not framing. It never names an alternative tool for the cases it refuses or for whole-environment setup, leaving the agent to infer that from other siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.