Skip to main content
Glama
irrenwill

secret-safe-env

by irrenwill

Set an .env secret (value never seen by the agent)

set_env_secret
Destructive

Adds secret environment variables to .env files by prompting the user to enter values in a masked dialog, keeping secrets hidden from the agent.

Instructions

Use this WHENEVER a task needs a secret/API key/token/password/connection string/credential written to a project .env file - e.g. "add my OpenAI key", "set DATABASE_URL", "configure my .env", "save this API token". You pass ONLY the variable NAME; the user types the value into a local masked dialog and it is written straight to .env - you never see or handle the value. DO NOT ask the user to paste the secret into the chat; DO NOT write the value or a placeholder yourself; DO NOT cat/read .env to verify (use env_key_exists). The value must be single-line (not for multi-line PEM keys / JSON blobs - for those, tell the user to edit .env manually).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesThe env var NAME in UPPER_SNAKE_CASE, e.g. OPENAI_API_KEY, DATABASE_URL, STRIPE_SECRET_KEY.
env_pathNoAbsolute path to the project .env. Pass the project-root .env path explicitly; if omitted it defaults to <CLAUDE_PROJECT_DIR or cwd>/.env, which may NOT be your workspace when launched via a runner.
Behavior5/5

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

The description explains that the agent never sees the value (user types into a masked dialog), the value is written straight to .env, and it must be single-line. This adds significant context beyond the annotations (readOnlyHint=false, destructiveHint=true). No contradiction.

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 about six sentences, covering all necessary guidance without excessive verbosity. It is front-loaded with the core purpose and immediately transitions to usage rules. Minor redundancy could be trimmed, but overall well-structured.

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?

The description addresses the key behavioral aspects (value invisibility, single-line constraint) and provides alternatives for multi-line secrets. It does not explicitly state what happens if the key already exists (overwrite) or if the .env file does not exist, but these are minor gaps given the overall clarity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema describes both parameters with clear descriptions and examples. The description reinforces that the agent passes only the key name and the user provides the value, and for env_path it explains the default behavior and warns about incorrect defaults when launched via a runner.

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 tool writes secrets/API keys/tokens to a .env file, with concrete examples like 'add my OpenAI key', 'set DATABASE_URL'. It distinguishes from the sibling env_key_exists by focusing on setting values.

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 the tool (whenever a secret needs to be written) and lists forbidden actions: 'DO NOT ask the user to paste the secret into the chat', 'DO NOT write the value or a placeholder yourself', 'DO NOT cat/read .env to verify (use env_key_exists)'.

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/irrenwill/secret-safe-env'

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