Check if a key exists in .env
env_key_existsCheck whether an environment variable name exists in a project .env file. Returns true or false to verify set_env_secret without exposing the value.
Instructions
Check whether an environment variable NAME already exists in a project .env file. Returns ONLY true/false - never the value. Use this to verify set_env_secret worked, INSTEAD of reading/cat-ing .env (which would expose the secret).
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": {
"key": "<key>"
},
"name": "env_key_exists"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The env var NAME to check, e.g. OPENAI_API_KEY. | |
| env_path | No | Absolute path to the project .env (same as set_env_secret). Defaults to <CLAUDE_PROJECT_DIR or cwd>/.env. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exists | Yes |