Skip to main content
Glama

set_secret

[secrets] Create or overwrite a single secret value, optionally with TTL/decay, per-env superposition, description, tags, and rotation hints.

Instructions

[secrets] Create or overwrite a single secret value, optionally with TTL/decay, per-env superposition, description, tags, and rotation hints. Use to add or update one key at a time; prefer import_dotenv for bulk .env ingest, generate_secret (with saveAs) to generate-and-store in one step, and entangle_secrets instead of duplicating the same value under two keys. Mutates the keyring (overwrites any existing value at the same key/scope), writes a 'write' event to the audit log, and triggers any matching hooks. Subject to tool policy. Returns a short confirmation text like '[scope] KEY saved' (or '[scope] KEY set for env:NAME' when env is provided).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNoIf set, writes this value to the named per-env state (superposition) instead of the default slot. Existing default value is preserved as state 'default'. Example: 'prod'.
keyYesSecret key name (UPPER_SNAKE_CASE recommended). Example: 'STRIPE_SECRET_KEY'.
tagsNoTag list for filtering and hook matching. Example: ['production', 'payments'].
orgIdNoOrganization identifier for org-scoped secrets. Required only when scope='org'. Example: 'acme-corp'.
scopeNoWhere the secret lives. 'global' = user keyring (default if omitted on reads), 'project' = scoped to projectPath, 'team' = team-shared (needs teamId), 'org' = org-shared (needs orgId).global
valueYesThe secret value to store. Stored as-is; never logged or echoed. May be empty only when `env` is provided to register a new env without a default.
teamIdNoTeam identifier for team-scoped secrets. Required only when scope='team'. Example: 'acme-platform'.
ttlSecondsNoQuantum decay window in seconds. After this many seconds the secret is marked expired (still readable, but `has_secret` returns false and `health_check` flags it). Omit for no decay.
descriptionNoFree-text human-readable description shown in `inspect_secret` and the dashboard.
projectPathNoAbsolute path to the project root for project-scoped secrets and policy resolution. Defaults to the MCP server's current working directory when omitted.
rotationFormatNoFormat used by `agent_scan --autoRotate` and `rotate_secret` when this secret expires. Pick the format that matches the upstream service's accepted shape.
rotationPrefixNoLiteral prefix prepended on auto-rotation (only used with rotationFormat 'api-key' or 'token'). Example: 'sk-'.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed12 schema fields changedv0.11.7
    • changedInput schema / properties / description / description
      Previous value: -"Human-readable description"New value: +"Free-text human-readable description shown in `inspect_secret` and the dashboard."
    • changedInput schema / properties / env / description
      Previous value: -"If provided, sets the value for this specific environment (superposition)"New value: +"If set, writes this value to the named per-env state (superposition) instead of the default slot. Existing default value is preserved as state 'default'. Example: 'prod'."
    • changedInput schema / properties / key / description
      Previous value: -"The secret key name"New value: +"Secret key name (UPPER_SNAKE_CASE recommended). Example: 'STRIPE_SECRET_KEY'."
    • changedInput schema / properties / orgId / description
      Previous value: -"Org identifier for org-scoped secrets"New value: +"Organization identifier for org-scoped secrets. Required only when scope='org'. Example: 'acme-corp'."
    • changedInput schema / properties / projectPath / description
      Previous value: -"Project root path for project-scoped secrets"New value: +"Absolute path to the project root for project-scoped secrets and policy resolution. Defaults to the MCP server's current working directory when omitted."
    • changedInput schema / properties / rotationFormat / description
      Previous value: -"Format for auto-rotation when this secret expires"New value: +"Format used by `agent_scan --autoRotate` and `rotate_secret` when this secret expires. Pick the format that matches the upstream service's accepted shape."
    • changedInput schema / properties / rotationPrefix / description
      Previous value: -"Prefix for auto-rotation (e.g. 'sk-')"New value: +"Literal prefix prepended on auto-rotation (only used with rotationFormat 'api-key' or 'token'). Example: 'sk-'."
    • changedInput schema / properties / scope / description
      Previous value: -"Scope: global, project, team, or org"New value: +"Where the secret lives. 'global' = user keyring (default if omitted on reads), 'project' = scoped to projectPath, 'team' = team-shared (needs teamId), 'org' = org-shared (needs orgId)."
    • changedInput schema / properties / tags / description
      Previous value: -"Tags for organization"New value: +"Tag list for filtering and hook matching. Example: ['production', 'payments']."
    • changedInput schema / properties / teamId / description
      Previous value: -"Team identifier for team-scoped secrets"New value: +"Team identifier for team-scoped secrets. Required only when scope='team'. Example: 'acme-platform'."
    • changedInput schema / properties / ttlSeconds / description
      Previous value: -"Time-to-live in seconds (quantum decay)"New value: +"Quantum decay window in seconds. After this many seconds the secret is marked expired (still readable, but `has_secret` returns false and `health_check` flags it). Omit for no decay."
    • changedInput schema / properties / value / description
      Previous value: -"The secret value"New value: +"The secret value to store. Stored as-is; never logged or echoed. May be empty only when `env` is provided to register a new env without a default."
  2. Changed4 schema fields changedv0.11.5
    • addedInput schema / properties / orgId
      Added value: +{
      +  "description": "Org identifier for org-scoped secrets",
      +  "type": "string"
      +}
    • changedInput schema / properties / scope / description
      Previous value: -"Scope: global or project"New value: +"Scope: global, project, team, or org"
    • changedInput schema / properties / scope / enum
      Previous value: -[
      -  "global",
      -  "project"
      -]New value: +[
      +  "global",
      +  "project",
      +  "team",
      +  "org"
      +]
    • addedInput schema / properties / teamId
      Added value: +{
      +  "description": "Team identifier for team-scoped secrets",
      +  "type": "string"
      +}
  3. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / rotationFormat
      Added value: +{
      +  "description": "Format for auto-rotation when this secret expires",
      +  "enum": [
      +    "hex",
      +    "base64",
      +    "alphanumeric",
      +    "uuid",
      +    "api-key",
      +    "token",
      +    "password"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / rotationPrefix
      Added value: +{
      +  "description": "Prefix for auto-rotation (e.g. 'sk-')",
      +  "type": "string"
      +}
  4. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries full burden and discloses mutation (overwrites), audit log writes, hook triggering, and policy subject. It lacks details on error handling or idempotency, but covers core behavioral traits well.

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 a single paragraph of about 4-5 sentences, covering purpose, alternatives, effects, and return format without redundancy. Slightly dense but concise and front-loaded.

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?

Given 12 parameters, no output schema, and no annotations, the description is fairly complete but could elaborate on error scenarios and return value format further. Still provides a solid overview.

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 description coverage is 100%, so baseline 3. The description adds value by explaining per-env superposition and rotation hints beyond schema, justifying a 4.

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 creates or overwrites a single secret value with multiple options (TTL, per-env, etc.), and explicitly distinguishes from sibling tools like import_dotenv, generate_secret, and entangle_secrets.

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 provides explicit when-to-use and when-not-to-use guidance, referencing specific alternatives for bulk import, generation, and duplication, and mentions side effects like mutation, audit logging, and hooks.

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

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/I4cTime/q-ring'

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