Skip to main content
Glama

Set environment variable

set_env
DestructiveIdempotent

Set or merge project secrets from values the human gave you (never invent them). Stored encrypted, never echoed back, and available to the app as process.env.KEY in preview and published apps; restart the preview to load them. Keys: letters, digits and _ (platform-reserved names are refused); values up to 8192 characters.

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": {
      "vars": "<vars>"
    },
    "name": "set_env"
  }
}

Input Schema

NameRequiredDescriptionDefault
varsYes
project_idNoProject id (or use session from use_project)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / vars / items / properties / key / pattern
      Added value: +"^[A-Za-z_][A-Za-z0-9_]*$"
    • addedInput schema / properties / vars / items / properties / value / maxLength
      Added value: +8192
    • addedInput schema / properties / vars / minItems
      Added value: +1
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With destructiveHint=true and idempotentHint=true already declared, the description still adds real value: encryption at rest, values never echoed back, runtime availability in preview and published apps, and the preview-restart requirement. What it leaves implicit is the overwrite case - 'set or merge' hints that an existing key with the same name is replaced, but that consequence is never stated outright.

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?

A single front-loaded paragraph: the action and the provenance constraint come first, followed by consequences and constraints in decreasing importance. Every clause carries information, though the key-format and size details partially duplicate what the JSON schema already enforces.

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?

For a two-parameter mutation with no output schema, the description covers storage, runtime exposure, the restart prerequisite, naming rules, and size limits - enough for an agent to call it correctly. The notable omission is the effect on an already-existing key of the same name, which matters given destructiveHint=true.

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 coverage is 50%: project_id is documented in the schema, while vars is not described there, so the description's explanation of key naming, reserved-name refusal, and the 8192-character value cap fills a genuine gap. However, the key pattern and maxLength are already encoded in the schema, so part of this is repetition, and the project_id-versus-session choice is not clarified here.

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

Purpose5/5

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

The description opens with a specific verb pair and resource: 'Set or merge project secrets'. It goes further to state where the values end up (process.env.KEY in preview and published apps), which is enough to distinguish this from the read-only sibling list_env_keys without opening either schema.

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 operating context: use values the human supplied and 'never invent them', plus the prerequisite action of restarting the preview to pick up changes. It does not explicitly name an alternative tool or a when-not-to-use case, so it stops short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources