Skip to main content
Glama

set_secret

Set or merge write-only secrets for a service and return only key names, so you can configure credentials without reading stored values.

Instructions

Set/merge write-only secrets for a service; returns key names only.

    WARNING: the values you pass here transit this agent's transcript in
    plaintext; for high-value shared keys (broadly-scoped API keys,
    credentials shared across every app) prefer ``nerdit secrets set --shared`` from the CLI
    instead of routing them through an agent. The leak-free path for any
    value: a human runs ``nerdit secrets set <service> --prompt KEY``
    (hidden input) and you only ever name ``KEY``; it is injected at
    launch, overriding an ``env`` key of the same name. You may set secrets
    before the service exists; the name is then reserved for your token
    until you deploy it (another token's deploy of that name gets 409
    ``service.name_claimed``).
    

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": {
      "service": "<service>",
      "values": "<values>"
    },
    "name": "set_secret"
  }
}

Input Schema

NameRequiredDescriptionDefault
valuesYesKEY → value pairs merged into the stored set: a listed key is overwritten, an unlisted one kept. Key names are env-var identifiers (``[A-Za-z_][A-Za-z0-9_]*``); a value may be multi-line but may contain no NUL and no control character other than tab/newline/CR. An empty map is refused.
serviceYesService (app, model or database) whose secrets this call modifies — need not exist yet: a set on an undeployed name reserves it for this token until deployed — or ``shared`` for the global scope (set: unscoped submitter or admin; delete: admin), read by a service only where a ``${secrets.shared.KEY}`` reference is honoured (``ai``/``db``/``edge_auth`` refs, ``token_ref``, a whole-value ``env``).
idempotency_keyNoCaller-chosen key: a retry with the same key replays the first result instead of acting twice. Omit and a fresh key is minted per call, so each call acts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.9.2
    • changedInput schema / properties / service / description
      Previous value: -"Service (app, model or database) whose secrets this call modifies — need not exist yet: a set on an undeployed name reserves it for this token until deployed — or ``shared`` for the global scope (set: unscoped submitter or admin; delete: admin), read by a service only where a ``${secrets.shared.KEY}`` reference is honoured (``ai``/``db``/``edge_auth`` refs, a git ``token_ref``), never via ``env``."New value: +"Service (app, model or database) whose secrets this call modifies — need not exist yet: a set on an undeployed name reserves it for this token until deployed — or ``shared`` for the global scope (set: unscoped submitter or admin; delete: admin), read by a service only where a ``${secrets.shared.KEY}`` reference is honoured (``ai``/``db``/``edge_auth`` refs, ``token_ref``, a whole-value ``env``)."
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description does the heavy lifting: it discloses write-only behavior, plaintext transcript leakage, return shape, launch-time injection overriding env, pre-deploy reservation, and the 409 service.name_claimed conflict. These are concrete behavioral traits not derivable from the schema alone.

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 purpose is front-loaded in the first sentence, and the warning is scoped immediately after it. The text is somewhat verbose with CLI instructions and repeated reservation detail, but each part is relevant to safe invocation.

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 write-only, security-sensitive tool with no annotations and no output schema, the description supplies the essential return shape, safety warning, injection/reservation behavior, and conflict outcome. The remaining auth detail is covered in the service parameter schema, so an agent has enough to call it correctly.

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 coverage is 100% and the schema already documents the merge/overwrite semantics, key-name constraints, service reservation, and idempotency. The description adds a 409 detail and safety context but little parameter-specific meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb and resource ('Set/merge write-only secrets for a service') and states the return ('key names only'), so the agent knows exactly what operation this is. It does not explicitly contrast with sibling tools such as set_variable or remove_secret, keeping it from a 5.

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

Usage Guidelines4/5

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

It gives a clear when-not-to-use case for high-value shared keys and names the CLI alternative, which is strong routing guidance. It does not compare against the MCP siblings (e.g., set_variable vs set_secret, list_secret_names), so usage versus siblings is only partly covered.

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