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 so later requests and the app can reuse them; credentials and secret-marked variables are refused.

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.

Input Schema

NameRequiredDescriptionDefault
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
environmentNo
overriddenByCommandLineNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.7.19

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover readOnly=false, destructive=true, idempotent=true, openWorld=false, and the description adds real value beyond them: credentials and developer-marked secrets are rejected, and setting values never expands the hosts requests can reach (a security-relevant constraint not expressible in annotations). It omits the behavior most tied to destructiveHint — whether existing variable values are overwritten or the set is replaced — which is a notable gap 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three compact sentences, front-loaded with what is saved and followed by the refusals. Minor cost: 'Values set here never let requests reach a new host' is terse and takes a moment to parse, but each sentence carries information.

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 and rich annotations, the description needn't explain returns, and it covers purpose, constraints, and credential alternatives. The remaining hole is overwrite/merge semantics and whether unlisted variables are preserved — relevant given destructiveHint=true and the nested variables map.

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 both parameters (variables map and environment) are already documented, including the example and the create-if-missing behavior. The description only echoes that these must be plain values, adding minimal semantics beyond the schema; baseline 3 applies.

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?

States a specific verb+resource ('Save plain variable values ... in an environment file of the workspace') and scopes it with concrete examples (baseUrl, userId) and hard limits (credentials and secrets refused). It distinguishes itself implicitly from set_environment by emphasizing value-setting in a file plus the note that new hosts never become reachable, though it never names the sibling that switches the active environment.

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?

Gives clear context: use this for plain values that later requests and the developer's app should consume, and it routes credential cases elsewhere ('the developer sets those in the app or with --var-from-env'). It also points at list_environments for naming the target environment. It stops short of explicit when-not-to-use guidance relative to siblings like set_environment.

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