Skip to main content
Glama

Set secret

set_secret
Idempotent

Deprecated, removed in 2.0: use manage_secrets with action set. Create a secret or replace its value in one environment. The previous value stays in the version history (secret_history lists it, restore_secret_version brings it back). Pass expectedVersion, from list_secrets, to write only if nobody changed the key since you read it. For many keys use import_env; to copy keys between environments without seeing the values use copy_environment. Protected and sealed keys are refused. The value is never echoed back. Audited. Requires secrets:write and the editor role.

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": {
      "project": "<project>",
      "environment": "<environment>",
      "key": "<key>",
      "value": "<value>"
    },
    "name": "set_secret"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesSecret key, e.g. DATABASE_URL
kindNosecret (masked, the default for a new key) or plain (shown unmasked in the UI and in list_secrets, for non-sensitive settings). Omit it to keep the current kind
noteNoShort note shown next to the key, up to 500 characters. Omit it to keep the current note
valueYesThe value to store, up to 64 KB, encrypted at rest
projectYesProject slug or id
environmentYesEnvironment slug or id, e.g. development, preview or production
expectedVersionNoUpdate only if the key is still at this version (the version list_secrets showed); a changed, renamed or deleted key fails instead of being written over or created

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / kind / description
      Previous value: -"plain entries are shown unmasked in the UI"New value: +"secret (masked, the default for a new key) or plain (shown unmasked in the UI and in list_secrets, for non-sensitive settings). Omit it to keep the current kind"
    • addedInput schema / properties / note / description
      Added value: +"Short note shown next to the key, up to 500 characters. Omit it to keep the current note"
    • addedInput schema / properties / value / description
      Added value: +"The value to store, up to 64 KB, encrypted at rest"
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only say readOnly=false, idempotent=true, destructive=false. The description adds real behavior beyond that: the old value is retained in version history and restorable, the value is never echoed back, protected/sealed keys are refused, writes are audited, and it requires secrets:write plus the editor role. The history-retention statement is consistent with destructiveHint=false and idempotentHint=true rather than contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the deprecation redirect before any capability text, then packs versioning, concurrency, refusal conditions, auth and routing into six short sentences with no filler. Each clause carries actionable information an agent needs at call time.

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?

For a 7-parameter mutation tool with no output schema, the description covers what an agent cannot get from structured fields: return-value behavior (value never echoed), authorization requirements, failure modes (protected/sealed keys, version mismatch), and recovery paths. Nothing essential for correct invocation is missing.

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 description coverage is 100%, so all seven parameters including kind, note and expectedVersion are already documented in the schema. The description's expectedVersion guidance ("from list_secrets, to write only if nobody changed the key since you read it") largely restates the schema text, and it adds no new semantics for value, kind or note. Baseline 3 is appropriate when the schema carries the parameter burden.

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?

States a specific verb and resource with scope: "Create a secret or replace its value in one environment." It also opens with a deprecation redirect naming the replacement (manage_secrets with action set), so an agent can immediately tell this apart from the successor and from copy_environment/import_env.

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?

Explicit when-to-use and when-to-use-something-else: import_env for many keys, copy_environment to copy without seeing values, secret_history/restore_secret_version for prior values, manage_secrets as the replacement. It also states a refusal condition (protected and sealed keys) and the expectedVersion precondition, leaving nothing to inference.

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