Skip to main content
Glama

set-env

DestructiveIdempotent

Set an environment variable for a project. Variables are encrypted at rest and injected at container runtime to configure your application securely.

Instructions

Set an environment variable for a project. Variables are encrypted at rest (AES-256-GCM) and injected at container runtime. NOTE: DATABASE_URL, PGHOST, PGPORT, PGUSER, PGPASSWORD, and PGDATABASE are all auto-injected for the managed PostgreSQL database — you do NOT need to set any of them manually. The PORT variable is auto-managed: 8080 for auto-detected frameworks (Next.js, Node.js, Python), or auto-detected from the Dockerfile EXPOSE directive for custom Dockerfile builds. IMPORTANT: Changing env vars does NOT auto-redeploy. You must call deploy or use the redeploy API endpoint to apply changes. For Next.js apps, NEXT_PUBLIC_* variables must be set BEFORE deploying since they are embedded at build time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesEnvironment variable name (e.g., STRIPE_KEY, REDIS_URL, API_SECRET). Do NOT set DATABASE_URL — it is auto-managed
valueYesEnvironment variable value. Will be encrypted at rest
project_idYesProject ID (UUID)
Behavior5/5

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

Annotations declare idempotentHint=true and destructiveHint=true, meaning the tool is safe to retry but changes take effect. The description adds critical context: variables are encrypted at rest (AES-256-GCM), they are injected at runtime, the auto-managed variable list, and the non-redeploy behavior. No contradiction with annotations.

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?

The description is substantial but front-loaded with the core action ('Set an environment variable for a project.') and then covers encryption, auto-managed vars, redeploy requirement, and Next.js specifics. Every sentence provides necessary information, though it could be slightly tighter by merging the auto-managed variable list into a single sentence.

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

Completeness5/5

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

Given the complexity (3 required params, mutation tool with deployment lifecycle dependency, encryption info, and sibling environment tools), the description covers all relevant aspects: what it does, what not to do, side effects, and special framework considerations. No output schema exists, but the description's behavioral coverage compensates adequately.

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% and already provides descriptions for all three parameters (key, value, project_id). The description adds value beyond the schema by clarifying which keys are auto-managed (DATABASE_URL, PORT) and why, effectively enriching the semantics of the key parameter without needing to repeat schema text.

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 clearly states the verb-resource pairing: "Set an environment variable for a project." It also distinguishes itself from sibling tools like get-env and deploy by explaining the relationship between setting env vars and redeployment.

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

Usage Guidelines5/5

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

The description explicitly tells when to use this tool, listing auto-managed variables (DATABASE_URL, PORT) that should NOT be set manually. It also explains that env var changes do not auto-redeploy and instructs the agent to call deploy or redeploy API to apply changes, plus special guidance for Next.js NEXT_PUBLIC_* variables.

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

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/sota-deploy/mcp-server'

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